Skip to content

Fix editor crash when anchor sliding, followup to #2682 #2726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions editor/src/messages/tool/tool_messages/path_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2261,14 +2261,17 @@ fn update_dynamic_hints(state: PathToolFsmState, responses: &mut VecDeque<Messag
let at_least_one_anchor_selected = shape_editor.selected_points().any(|point| matches!(point, ManipulatorPointId::Anchor(_)));
let at_least_one_point_selected = shape_editor.selected_points().count() >= 1;

let single_colinear_anchor_selected = if single_anchor_selected {
let anchor = shape_editor.selected_points().next().unwrap();
let layer = document.network_interface.selected_nodes().selected_layers(document.metadata()).next().unwrap();
let vector_data = document.network_interface.compute_modified_vector(layer).unwrap();
vector_data.colinear(*anchor)
} else {
false
};
let mut single_colinear_anchor_selected = false;
if single_anchor_selected {
if let (Some(anchor), Some(layer)) = (
shape_editor.selected_points().next(),
document.network_interface.selected_nodes().selected_layers(document.metadata()).next(),
) {
if let Some(vector_data) = document.network_interface.compute_modified_vector(layer) {
single_colinear_anchor_selected = vector_data.colinear(*anchor)
}
}
}

let mut drag_selected_hints = vec![HintInfo::mouse(MouseMotion::LmbDrag, "Drag Selected")];
let mut delete_selected_hints = vec![HintInfo::keys([Key::Delete], "Delete Selected")];
Expand Down
Loading