Implement extending, joining, and creating new subpaths with the Spline tool (#2203)

* visualize spline end points using overlays

* implement for spline tool to extend path by draging end points

* allow holding Shift to begin drawing a new spline subpath in the same layer

* implement spline tool to join two endpoints

* fix naming

* refactor spline tool

* impl spline tool snapping and overlays

* fix joining path and refactor

* improve join_path comment

* fix snapping overlays flickering by ignoring snapping in current layer

* fix inserting single point on aborting spline tool

* add snapping for endpoint even when regular snapping is disabled

* fix extending

* fix inserting new point instead of extending and Add hint for Shift to append

* fix grammatical errors and code style

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Priyanshu
2025-01-25 16:54:08 +05:30
committed by GitHub
parent 33ac141fb8
commit f7b7f6b9f4
5 changed files with 163 additions and 36 deletions

View File

@@ -270,7 +270,7 @@ pub fn input_mappings() -> Mapping {
//
// SplineToolMessage
entry!(PointerMove; action_dispatch=SplineToolMessage::PointerMove),
entry!(KeyDown(MouseLeft); action_dispatch=SplineToolMessage::DragStart),
entry!(KeyDown(MouseLeft); action_dispatch=SplineToolMessage::DragStart { append_to_selected: Shift }),
entry!(KeyUp(MouseLeft); action_dispatch=SplineToolMessage::DragStop),
entry!(KeyDown(MouseRight); action_dispatch=SplineToolMessage::Confirm),
entry!(KeyDown(Escape); action_dispatch=SplineToolMessage::Confirm),