Skip to content

Commit 84470b6

Browse files
indierustyKeavon
andauthored
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 <keavon@keavon.com>
1 parent c384175 commit 84470b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2789,7 +2789,7 @@ impl Fsm for PathToolFsmState {
27892789
segments_map.insert(segment_id, new_segment_id);
27902790

27912791
let points = pathseg_points(bezier);
2792-
let handles = [points.p1, points.p2];
2792+
let handles = [points.p1.map(|handle| handle - points.p0), points.p2.map(|handle| handle - points.p3)];
27932793

27942794
let points = [points_map[&start], points_map[&end]];
27952795
let modification_type = VectorModificationType::InsertSegment { id: new_segment_id, points, handles };
@@ -2895,7 +2895,7 @@ impl Fsm for PathToolFsmState {
28952895
segments_map.insert(segment_id, new_id);
28962896

28972897
let points = pathseg_points(bezier);
2898-
let handles = [points.p1, points.p2];
2898+
let handles = [points.p1.map(|handle| handle - points.p0), points.p2.map(|handle| handle - points.p3)];
28992899

29002900
let points = [points_map[&start], points_map[&end]];
29012901
let modification_type = VectorModificationType::InsertSegment { id: new_id, points, handles };

0 commit comments

Comments
 (0)