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

This commit is contained in:
Keavon Chambers
2026-08-18 17:51:29 -07:00
committed by GitHub
parent 48e776c1af
commit 39425ca7ea
10 changed files with 49 additions and 119 deletions

View File

@@ -696,7 +696,7 @@ impl TableItemLayout for Vector {
}
VectorTableTab::Regions => {
table_rows.push(column_headings(&["", "segment_range"]));
table_rows.extend(self.region_domain.iter().map(|(id, 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 {} Segment {}", segment_range.start().inner(), segment_range.end().inner()))

View File

@@ -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));
}
}

View File

@@ -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)]
@@ -1852,7 +1852,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));