From 84470b6b6d2e8fe0b7e646ca32821052adf2efbb Mon Sep 17 00:00:00 2001 From: Priyanshu Date: Mon, 8 Sep 2025 10:41:15 +0530 Subject: [PATCH] Fix a regression with duplicating or pasting vector geometry in the Path tool (#3142) * fix path tool duplication * fix copy and paste --------- Co-authored-by: Keavon Chambers --- editor/src/messages/tool/tool_messages/path_tool.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/src/messages/tool/tool_messages/path_tool.rs b/editor/src/messages/tool/tool_messages/path_tool.rs index 3dadf888b..3ae2f57f6 100644 --- a/editor/src/messages/tool/tool_messages/path_tool.rs +++ b/editor/src/messages/tool/tool_messages/path_tool.rs @@ -2789,7 +2789,7 @@ impl Fsm for PathToolFsmState { segments_map.insert(segment_id, new_segment_id); let points = pathseg_points(bezier); - let handles = [points.p1, points.p2]; + let handles = [points.p1.map(|handle| handle - points.p0), points.p2.map(|handle| handle - points.p3)]; let points = [points_map[&start], points_map[&end]]; let modification_type = VectorModificationType::InsertSegment { id: new_segment_id, points, handles }; @@ -2895,7 +2895,7 @@ impl Fsm for PathToolFsmState { segments_map.insert(segment_id, new_id); let points = pathseg_points(bezier); - let handles = [points.p1, points.p2]; + let handles = [points.p1.map(|handle| handle - points.p0), points.p2.map(|handle| handle - points.p3)]; let points = [points_map[&start], points_map[&end]]; let modification_type = VectorModificationType::InsertSegment { id: new_id, points, handles };