Delete the dead StrokeId and FillId attributes from the Vector segment and region domains (#4461)

This commit is contained in:
Keavon Chambers
2026-09-15 22:08:40 +02:00
committed by Dennis Kobert
parent 40faebb68b
commit 64d2436add
10 changed files with 50 additions and 121 deletions
@@ -619,12 +619,11 @@ impl TableItemLayout for Vector {
}));
}
VectorTableTab::Regions => {
table_rows.push(column_headings(&["", "segment_range", "fill"]));
table_rows.extend(self.region_domain.iter().map(|(id, segment_range, fill)| {
table_rows.push(column_headings(&["", "segment_range"]));
table_rows.extend(self.region_domain.iter().map(|(id, segment_range)| {
vec![
TextLabel::new(format!("{}", id.inner())).narrow(true).widget_instance(),
TextLabel::new(format!("{segment_range:?}")).narrow(true).widget_instance(),
TextLabel::new(format!("{}", fill.inner())).narrow(true).widget_instance(),
]
}));
}
@@ -2781,7 +2781,7 @@ impl Fsm for PathToolFsmState {
let find_index = |id: PointId| new_vector.point_domain.iter().enumerate().find(|(_, (point_id, _))| *point_id == id).map(|(index, _)| index);
// Add segments which have selected ends
for ((segment_id, segment, start, end), stroke) in old_vector.segment_iter().zip(old_vector.segment_domain.stroke().iter()) {
for (segment_id, segment, start, end) in old_vector.segment_iter() {
let both_ends_selected = layer_selection_state.is_point_selected(ManipulatorPointId::Anchor(start)) && layer_selection_state.is_point_selected(ManipulatorPointId::Anchor(end));
let segment_selected = layer_selection_state.is_segment_selected(segment_id);
@@ -2791,7 +2791,7 @@ impl Fsm for PathToolFsmState {
error!("Point does not exist in point domain");
return PathToolFsmState::Ready;
};
new_vector.segment_domain.push(segment_id, start_index, end_index, segment_to_handles(&segment), *stroke);
new_vector.segment_domain.push(segment_id, start_index, end_index, segment_to_handles(&segment));
}
}
@@ -21,7 +21,7 @@ use graphene_std::Color;
use graphene_std::vector::misc::pathseg_points;
use graphene_std::vector::misc::{HandleId, ManipulatorPointId, dvec2_to_point};
use graphene_std::vector::style::FillChoice;
use graphene_std::vector::{NoHashBuilder, PointId, SegmentId, StrokeId, Vector, VectorModificationType};
use graphene_std::vector::{NoHashBuilder, PointId, SegmentId, Vector, VectorModificationType};
use kurbo::{BezPath, CubicBez, PathSeg};
#[derive(Default, ExtractField)]
@@ -1850,7 +1850,7 @@ impl Fsm for PenToolFsmState {
// We have the point. Join the 2 vertices and check if any path is closed.
if let Some(end) = closest_point {
let segment_id = SegmentId::generate();
vector.push(segment_id, start, end, (Some(handle_start), Some(handle_end)), StrokeId::ZERO);
vector.push(segment_id, start, end, (Some(handle_start), Some(handle_end)));
let grouped_segments = vector.auto_join_paths();
let closed_paths = grouped_segments.iter().filter(|path| path.is_closed() && path.contains(segment_id));