mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 20:48:11 +08:00
Fix editor crash due to mismanaged selected points on layers (#2640)
* Add hash sets to hold ignored points in SelectedLayerState * Fix non selected anchor dragging * Update selected points when ignoring handles or anchors * Refactor selected points status logic * Refactor ignore_handles and ignore_anchors bools to ShapeState * Add back in ignore_anchors and ignore_handles in SelectedLayerState * Code review --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
7a2144e31e
commit
ea59f10b50
@@ -100,6 +100,9 @@ pub enum PathToolMessage {
|
||||
},
|
||||
SwapSelectedHandles,
|
||||
UpdateOptions(PathOptionsUpdate),
|
||||
UpdateSelectedPointsStatus {
|
||||
overlay_context: OverlayContext,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Hash, Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize, specta::Type)]
|
||||
@@ -989,24 +992,18 @@ impl Fsm for PathToolFsmState {
|
||||
shape_editor.set_selected_layers(target_layers);
|
||||
|
||||
responses.add(OverlaysMessage::Draw);
|
||||
self
|
||||
}
|
||||
(_, PathToolMessage::UpdateSelectedPointsStatus { overlay_context }) => {
|
||||
let display_anchors = overlay_context.visibility_settings.anchors();
|
||||
let display_handles = overlay_context.visibility_settings.handles();
|
||||
|
||||
shape_editor.update_selected_anchors_status(display_anchors);
|
||||
shape_editor.update_selected_handles_status(display_handles);
|
||||
|
||||
responses.add(PathToolMessage::SelectedPointUpdated);
|
||||
self
|
||||
}
|
||||
(_, PathToolMessage::Overlays(mut overlay_context)) => {
|
||||
let display_anchors = overlay_context.visibility_settings.anchors();
|
||||
let display_handles = overlay_context.visibility_settings.handles();
|
||||
if !display_handles {
|
||||
shape_editor.ignore_selected_handles();
|
||||
} else {
|
||||
shape_editor.mark_selected_handles();
|
||||
}
|
||||
if !display_anchors {
|
||||
shape_editor.ignore_selected_anchors();
|
||||
} else {
|
||||
shape_editor.mark_selected_anchors();
|
||||
}
|
||||
|
||||
// TODO: find the segment ids of which the selected points are a part of
|
||||
|
||||
match tool_options.path_overlay_mode {
|
||||
@@ -1133,6 +1130,7 @@ impl Fsm for PathToolFsmState {
|
||||
}
|
||||
|
||||
responses.add(PathToolMessage::SelectedPointUpdated);
|
||||
responses.add(PathToolMessage::UpdateSelectedPointsStatus { overlay_context });
|
||||
self
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user