Skip to content

Commit 2bcfe5e

Browse files
0SlowPoke0Keavon
andauthored
In the Pen tool, make Space drag the whole manipulator group while dragging a handle (#2416)
* implemented space drag need to handle unwrap + clean snap cache * completed the space drag need to refactor * refactor * small comment changes * formating_fix --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
1 parent c0d3eb8 commit 2bcfe5e

File tree

3 files changed

+281
-69
lines changed

3 files changed

+281
-69
lines changed

editor/src/messages/input_mapper/input_mappings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ pub fn input_mappings() -> Mapping {
253253
entry!(KeyDown(KeyJ); modifiers=[Accel], action_dispatch=ToolMessage::Path(PathToolMessage::ClosePath)),
254254
//
255255
// PenToolMessage
256-
entry!(PointerMove; refresh_keys=[Control, Alt, Shift, KeyC], action_dispatch=PenToolMessage::PointerMove { snap_angle: Shift, break_handle: Alt, lock_angle: Control, colinear: KeyC }),
256+
entry!(PointerMove; refresh_keys=[Control, Alt, Shift, KeyC], action_dispatch=PenToolMessage::PointerMove { snap_angle: Shift, break_handle: Alt, lock_angle: Control, colinear: KeyC, move_anchor_with_handles: Space }),
257257
entry!(KeyDown(MouseLeft); action_dispatch=PenToolMessage::DragStart { append_to_selected: Shift }),
258258
entry!(KeyUp(MouseLeft); action_dispatch=PenToolMessage::DragStop),
259259
entry!(KeyDown(MouseRight); action_dispatch=PenToolMessage::Confirm),

editor/src/messages/tool/common_functionality/snapping.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fn get_grid_intersection(snap_to: DVec2, lines: &[SnappedLine]) -> Option<Snappe
187187
best
188188
}
189189

190-
#[derive(Default)]
190+
#[derive(Default, Clone, Debug)]
191191
pub struct SnapCache {
192192
pub manipulators: HashMap<LayerNodeIdentifier, HashSet<PointId, NoHashBuilder>, NoHashBuilder>,
193193
pub unselected: Vec<SnapCandidatePoint>,

0 commit comments

Comments
 (0)