Rename the nodes 'Length' -> 'Magnitude', 'Flatten Path' -> 'Combine Paths', 'Vec2 Value' -> 'Combine Vec2', and add a new 'Vec2 Value' node (#4349)

* Rename the node 'Length' -> 'Magnitude'

* Rename the node 'Flatten Path' -> 'Combine Paths'

* Replace the node 'Vec2 Value' with 'Combine Vec2' and add a new 'Vec2 Value' that's actually a vec2

* Update demo artwork
This commit is contained in:
Keavon Chambers
2026-07-17 09:43:04 -07:00
committed by Dennis Kobert
parent 9556904aed
commit 4f49c000e8
14 changed files with 73 additions and 40 deletions

View File

@@ -2057,9 +2057,9 @@ fn flatten_path_core<'e>(
))
}
// TODO: Rename to "Combine Paths" and make this happen per-element instead of flattening every element into a single path. The migration for this should then become a Flatten Vector -> Combine Paths pair of nodes.
// TODO: Make this happen per-element instead of flattening every element into a single path. The migration for this should then become a Flatten Vector -> Combine Paths pair of nodes.
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
pub fn flatten_path<'e>(
pub fn combine_paths<'e>(
ctx: impl Ctx + ExtractArena<'e> + ExtractIndex + InjectIndex + Copy,
content: IList<Graphic<'static>>,
) -> Result<
@@ -2087,10 +2087,10 @@ pub fn flatten_path<'e>(
Ok((content.lane(carrier).map_element(element), transform, fill, stroke, layer_path, merged))
}
/// The path flattening over a plain vector level, as [`flatten_path`].
/// Registered under the flatten path identifier.
/// The path flattening over a plain vector level, as [`combine_paths`].
/// Registered under the combine paths identifier.
#[node_macro::node(category(""))]
pub fn flatten_path_vector<'e>(
pub fn combine_paths_vector<'e>(
ctx: impl Ctx + ExtractArena<'e> + ExtractIndex + InjectIndex + Copy,
content: IList<Vector>,
) -> Result<
@@ -2118,7 +2118,7 @@ pub fn flatten_path_vector<'e>(
Ok((content.lane(carrier).map_element(element), transform, fill, stroke, layer_path, merged))
}
pub use _flatten_path_vector_mod::flatten_path_vector_entries;
pub use _combine_paths_vector_mod::combine_paths_vector_entries;
/// Convert vector geometry into a polyline composed of evenly spaced points.
#[node_macro::node(category("Vector: Modifier"), path(core_types::vector), properties("sample_polyline_properties"), memoize)]
@@ -4137,6 +4137,7 @@ mod test {
assert_eq!(manipulator_groups_anchors[i], expected_bounding_box[i]);
}
}
#[test]
fn sample_polyline() {
let path = BezPath::from_vec(vec![PathEl::MoveTo(Point::ZERO), PathEl::CurveTo(Point::ZERO, Point::new(100., 0.), Point::new(100., 0.))]);