Remove remnant dead code across the Subpath, Vector, and editor geometry API surfaces (#4454)

This commit is contained in:
Keavon Chambers
2026-08-18 12:34:34 -07:00
committed by GitHub
parent 2df0bd25c3
commit 20af96c1d9
25 changed files with 58 additions and 533 deletions

View File

@@ -74,7 +74,7 @@ pub mod math {
pub use core_types::math::quad;
pub mod math_ext {
pub use vector_types::{QuadExt, RectExt};
pub use vector_types::QuadExt;
}
}

View File

@@ -323,8 +323,8 @@ mod test {
.await;
let vector_list = List::new_from_item(vector_nodes::combine_paths(Footprint::default(), List::new_from_element(Graphic::VectorList(repeated))).await);
let vector = vector_list.element(0).unwrap();
assert_eq!(vector.region_manipulator_groups().count(), 3);
for (index, (_, manipulator_groups)) in vector.region_manipulator_groups().enumerate() {
assert_eq!(vector.stroke_manipulator_groups().count(), 3);
for (index, (manipulator_groups, _)) in vector.stroke_manipulator_groups().enumerate() {
assert!((manipulator_groups[0].anchor - direction * index as f64 / (count - 1) as f64).length() < 1e-5);
}
}
@@ -342,9 +342,9 @@ mod test {
.await;
let vector_list = List::new_from_item(vector_nodes::combine_paths(Footprint::default(), List::new_from_element(Graphic::VectorList(repeated))).await);
let vector = vector_list.element(0).unwrap();
assert_eq!(vector.region_manipulator_groups().count(), 1);
assert_eq!(vector.stroke_manipulator_groups().count(), 1);
let (_, manipulator_groups) = vector.region_manipulator_groups().next().unwrap();
let (manipulator_groups, _) = vector.stroke_manipulator_groups().next().unwrap();
let anchor = manipulator_groups[0].anchor;
assert!(anchor.length() < 1e-5, "Expected the single copy to be untransformed, found anchor {anchor}");
}
@@ -364,8 +364,8 @@ mod test {
.await;
let vector_list = List::new_from_item(vector_nodes::combine_paths(Footprint::default(), List::new_from_element(Graphic::VectorList(repeated))).await);
let vector = vector_list.element(0).unwrap();
assert_eq!(vector.region_manipulator_groups().count(), 8);
for (index, (_, manipulator_groups)) in vector.region_manipulator_groups().enumerate() {
assert_eq!(vector.stroke_manipulator_groups().count(), 8);
for (index, (manipulator_groups, _)) in vector.stroke_manipulator_groups().enumerate() {
assert!((manipulator_groups[0].anchor - direction * index as f64 / (count - 1) as f64).length() < 1e-5);
}
}
@@ -383,9 +383,9 @@ mod test {
.await;
let vector_list = List::new_from_item(vector_nodes::combine_paths(Footprint::default(), List::new_from_element(Graphic::VectorList(repeated))).await);
let vector = vector_list.element(0).unwrap();
assert_eq!(vector.region_manipulator_groups().count(), 8);
assert_eq!(vector.stroke_manipulator_groups().count(), 8);
for (index, (_, manipulator_groups)) in vector.region_manipulator_groups().enumerate() {
for (index, (manipulator_groups, _)) in vector.stroke_manipulator_groups().enumerate() {
let expected_angle = (index as f64 + 1.) * 45.;
let center = (manipulator_groups[0].anchor + manipulator_groups[2].anchor) / 2.;

View File

@@ -42,11 +42,7 @@ fn arc(
radius,
start_angle / 360. * std::f64::consts::TAU,
sweep_angle / 360. * std::f64::consts::TAU,
match arc_type {
ArcType::Open => subpath::ArcType::Open,
ArcType::Closed => subpath::ArcType::Closed,
ArcType::PieSlice => subpath::ArcType::PieSlice,
},
arc_type,
)))
}

View File

@@ -3776,12 +3776,12 @@ mod test {
async fn bounding_box() {
let bounding_box = super::bounding_box((), Item::new_from_element(Vector::from_bezpath(Rect::new(-1., -1., 1., 1.).to_path(DEFAULT_ACCURACY)))).await;
let bounding_box = bounding_box.element();
assert_eq!(bounding_box.region_manipulator_groups().count(), 1);
assert_eq!(bounding_box.stroke_manipulator_groups().count(), 1);
let manipulator_groups_anchors = bounding_box
.region_manipulator_groups()
.stroke_manipulator_groups()
.next()
.unwrap()
.1
.0
.iter()
.map(|manipulators| manipulators.anchor)
.collect::<Vec<DVec2>>();
@@ -3794,12 +3794,12 @@ mod test {
square.with_attribute_mut_or_default(ATTR_TRANSFORM, 0, |t: &mut DAffine2| *t *= DAffine2::from_angle(std::f64::consts::FRAC_PI_4));
let bounding_box = BoundingBoxNodeMapped { content: FutureWrapperNode(square) }.eval(Footprint::default()).await;
let bounding_box = bounding_box.element(0).unwrap();
assert_eq!(bounding_box.region_manipulator_groups().count(), 1);
assert_eq!(bounding_box.stroke_manipulator_groups().count(), 1);
let manipulator_groups_anchors = bounding_box
.region_manipulator_groups()
.stroke_manipulator_groups()
.next()
.unwrap()
.1
.0
.iter()
.map(|manipulators| manipulators.anchor)
.collect::<Vec<DVec2>>();
@@ -3831,9 +3831,9 @@ mod test {
let combined = List::new_from_item(super::combine_paths(Footprint::default(), List::new_from_element(Graphic::VectorList(copy_to_points))).await);
let combined_copy_to_points = combined.element(0).unwrap();
assert_eq!(combined_copy_to_points.region_manipulator_groups().count(), expected_points.len());
assert_eq!(combined_copy_to_points.stroke_manipulator_groups().count(), expected_points.len());
for (index, (_, manipulator_groups)) in combined_copy_to_points.region_manipulator_groups().enumerate() {
for (index, (manipulator_groups, _)) in combined_copy_to_points.stroke_manipulator_groups().enumerate() {
let offset = expected_points[index];
let manipulator_groups_anchors = manipulator_groups.iter().map(|manipulators| manipulators.anchor).collect::<Vec<DVec2>>();
assert_eq!(