Skip to content

Commit 0d43ad2

Browse files
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 <keavon@keavon.com>
1 parent 30abc92 commit 0d43ad2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

editor/src/messages/tool/tool_messages/path_tool.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ struct PathToolData {
532532
drill_through_cycle_index: usize,
533533
drill_through_cycle_count: usize,
534534
hovered_layers: Vec<LayerNodeIdentifier>,
535-
ghost_outline: Vec<(Vec<ClickTargetType>, DAffine2)>,
535+
ghost_outline: Vec<(Vec<ClickTargetType>, LayerNodeIdentifier)>,
536536
single_path_node_compatible_layer_selected: bool,
537537
}
538538

@@ -628,8 +628,8 @@ impl PathToolData {
628628
for &layer in shape_editor.selected_shape_state.keys() {
629629
// We probably need to collect here
630630
let outline: Vec<ClickTargetType> = document.metadata().layer_with_free_points_outline(layer).cloned().collect();
631-
let transform = document.metadata().transform_to_viewport(layer);
632-
self.ghost_outline.push((outline, transform));
631+
632+
self.ghost_outline.push((outline, layer));
633633
}
634634
}
635635

@@ -1490,8 +1490,9 @@ impl Fsm for PathToolFsmState {
14901490
}
14911491
(_, PathToolMessage::Overlays(mut overlay_context)) => {
14921492
if matches!(self, Self::Dragging(_)) {
1493-
for (outline, transform) in &tool_data.ghost_outline {
1494-
overlay_context.outline(outline.iter(), *transform, Some(COLOR_OVERLAY_GRAY));
1493+
for (outline, layer) in &tool_data.ghost_outline {
1494+
let transform = document.metadata().transform_to_viewport(*layer);
1495+
overlay_context.outline(outline.iter(), transform, Some(COLOR_OVERLAY_GRAY));
14951496
}
14961497
}
14971498

0 commit comments

Comments
 (0)