From 0d43ad2ea08167d88a36f28cbe89a953d40d09a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szilveszter=20=C3=81br=C3=A1m?= <94196623+silwesterabram@users.noreply.github.com> Date: Thu, 24 Jul 2025 11:28:17 +0200 Subject: [PATCH] Fix Path tool path drag ghost outline sticking to viewport, not moving with document while dragging (#2912) * Added ghost outline clearing when moving outlines via Path Tool * Fix ghost outline staying fixed during drag by storing it in document space --------- Co-authored-by: Keavon Chambers --- editor/src/messages/tool/tool_messages/path_tool.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/editor/src/messages/tool/tool_messages/path_tool.rs b/editor/src/messages/tool/tool_messages/path_tool.rs index f5ebc331..f4c42e53 100644 --- a/editor/src/messages/tool/tool_messages/path_tool.rs +++ b/editor/src/messages/tool/tool_messages/path_tool.rs @@ -532,7 +532,7 @@ struct PathToolData { drill_through_cycle_index: usize, drill_through_cycle_count: usize, hovered_layers: Vec, - ghost_outline: Vec<(Vec, DAffine2)>, + ghost_outline: Vec<(Vec, LayerNodeIdentifier)>, single_path_node_compatible_layer_selected: bool, } @@ -628,8 +628,8 @@ impl PathToolData { for &layer in shape_editor.selected_shape_state.keys() { // We probably need to collect here let outline: Vec = document.metadata().layer_with_free_points_outline(layer).cloned().collect(); - let transform = document.metadata().transform_to_viewport(layer); - self.ghost_outline.push((outline, transform)); + + self.ghost_outline.push((outline, layer)); } } @@ -1490,8 +1490,9 @@ impl Fsm for PathToolFsmState { } (_, PathToolMessage::Overlays(mut overlay_context)) => { if matches!(self, Self::Dragging(_)) { - for (outline, transform) in &tool_data.ghost_outline { - overlay_context.outline(outline.iter(), *transform, Some(COLOR_OVERLAY_GRAY)); + for (outline, layer) in &tool_data.ghost_outline { + let transform = document.metadata().transform_to_viewport(*layer); + overlay_context.outline(outline.iter(), transform, Some(COLOR_OVERLAY_GRAY)); } }