mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Delete the dead StrokeId and FillId attributes from the Vector segment and region domains (#4461)
This commit is contained in:
@@ -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()))
|
||||
|
||||
@@ -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)]
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user