Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the Pen tool's colinearity and equidistance controls #2242

Merged
merged 24 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bd8f01c
basic implementation done now refactor
0SlowPoke0 Jan 29, 2025
e71831d
fixed overlays refactoring need to fix colinear(update it)
0SlowPoke0 Jan 30, 2025
667e6bb
Merge branch 'GraphiteEditor:master' into drag_anchor_pen
0SlowPoke0 Jan 30, 2025
db828a2
more_refactoring ,only toggle C for grs to be done(if required)
0SlowPoke0 Jan 30, 2025
0b20cbc
Merge branch 'GraphiteEditor:master' into drag_anchor_pen
0SlowPoke0 Jan 31, 2025
273a02f
cleanup
0SlowPoke0 Jan 31, 2025
bd1d7bd
cleanup
0SlowPoke0 Jan 31, 2025
d7b8446
Merge branch 'drag_anchor_pen' of https://github.com/0SlowPoke0/Graph…
0SlowPoke0 Jan 31, 2025
5109b12
more formatting checks
0SlowPoke0 Jan 31, 2025
c922c86
refactoring alt fixed hints fixed
0SlowPoke0 Feb 1, 2025
d88b02f
Merge branch 'master' into drag_anchor_pen
0SlowPoke0 Feb 1, 2025
adc510d
Merge branch 'master' into drag_anchor_pen
0SlowPoke0 Feb 2, 2025
965667f
code-review-changes
0SlowPoke0 Feb 2, 2025
89c19a7
path-tool-tab-fix
0SlowPoke0 Feb 3, 2025
475ad43
fixed bugs
0SlowPoke0 Feb 4, 2025
bc394ef
Merge branch 'master' into drag_anchor_pen
Keavon Feb 4, 2025
bfa58b1
some refactor
0SlowPoke0 Feb 4, 2025
de0eef1
Merge branch 'drag_anchor_pen' of https://github.com/0SlowPoke0/Graph…
0SlowPoke0 Feb 4, 2025
cd3b1bd
Merge branch 'drag_anchor_pen' of https://github.com/0SlowPoke0/Graph…
0SlowPoke0 Feb 4, 2025
9348df5
Merge branch 'drag_anchor_pen' of https://github.com/0SlowPoke0/Graph…
0SlowPoke0 Feb 4, 2025
e621dbc
Merge branch 'master' into drag_anchor_pen
0SlowPoke0 Feb 4, 2025
a141ac9
fixed ctrl_snap
0SlowPoke0 Feb 4, 2025
7e7a726
added lock-overlays and fixed grs bug
0SlowPoke0 Feb 4, 2025
0dfc2d7
Code review
Keavon Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions editor/src/messages/input_mapper/input_mappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub fn input_mappings() -> Mapping {
entry!(KeyDown(Backspace); modifiers=[Accel], action_dispatch=PathToolMessage::DeleteAndBreakPath),
entry!(KeyDown(Delete); modifiers=[Shift], action_dispatch=PathToolMessage::BreakPath),
entry!(KeyDown(Backspace); modifiers=[Shift], action_dispatch=PathToolMessage::BreakPath),
entry!(KeyDown(Tab); action_dispatch=PathToolMessage::SwapSelectedHandles),
entry!(KeyDownNoRepeat(Tab); action_dispatch=PathToolMessage::SwapSelectedHandles),
entry!(KeyDown(MouseLeft); action_dispatch=PathToolMessage::MouseDown { direct_insert_without_sliding: Control, extend_selection: Shift, lasso_select: Control }),
entry!(KeyDown(MouseRight); action_dispatch=PathToolMessage::RightClick),
entry!(KeyDown(Escape); action_dispatch=PathToolMessage::Escape),
Expand Down Expand Up @@ -254,7 +254,7 @@ pub fn input_mappings() -> Mapping {
entry!(KeyDown(KeyJ); modifiers=[Accel], action_dispatch=ToolMessage::Path(PathToolMessage::ClosePath)),
//
// PenToolMessage
entry!(PointerMove; refresh_keys=[Control, Alt, Shift], action_dispatch=PenToolMessage::PointerMove { snap_angle: Shift, break_handle: Alt, lock_angle: Control}),
entry!(PointerMove; refresh_keys=[Control, Alt, Shift, KeyC], action_dispatch=PenToolMessage::PointerMove { snap_angle: Shift, break_handle: Alt, lock_angle: Control, colinear: KeyC }),
entry!(KeyDown(MouseLeft); action_dispatch=PenToolMessage::DragStart { append_to_selected: Shift }),
entry!(KeyUp(MouseLeft); action_dispatch=PenToolMessage::DragStop),
entry!(KeyDown(MouseRight); action_dispatch=PenToolMessage::Confirm),
Expand Down
39 changes: 27 additions & 12 deletions editor/src/messages/tool/tool_messages/path_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,16 +1185,9 @@ impl Fsm for PathToolFsmState {
.push(HintGroup(vec![HintInfo::mouse(MouseMotion::Rmb, ""), HintInfo::keys([Key::Escape], "Cancel").prepend_slash()]));

let drag_anchor = HintInfo::keys([Key::Space], "Drag Anchor");
let point_select_state_hint_group = match dragging_state.point_select_state {
PointSelectState::HandleNoPair => {
let mut hints = vec![drag_anchor];
hints.push(HintInfo::keys([Key::Shift], "Snap 15°"));
hints.push(HintInfo::keys([Key::Control], "Lock Angle"));
hints
}
PointSelectState::HandleWithPair => {
let mut hints = vec![drag_anchor];
hints.push(HintInfo::keys([Key::Tab], "Swap Selected Handles"));
let toggle_group = match dragging_state.point_select_state {
PointSelectState::HandleNoPair | PointSelectState::HandleWithPair => {
let mut hints = vec![HintInfo::keys([Key::Tab], "Swap Selected Handles")];
hints.push(HintInfo::keys(
[Key::KeyC],
if colinear == ManipulatorAngle::Colinear {
Expand All @@ -1203,18 +1196,40 @@ impl Fsm for PathToolFsmState {
"Make Handles Colinear"
},
));
hints
}
PointSelectState::Anchor => Vec::new(),
};
let hold_group = match dragging_state.point_select_state {
PointSelectState::HandleNoPair => {
let mut hints = vec![];
if colinear != ManipulatorAngle::Free {
hints.push(HintInfo::keys([Key::Alt], "Equidistant Handles"));
}
hints.push(HintInfo::keys([Key::Shift], "Snap 15°"));
hints.push(HintInfo::keys([Key::Control], "Lock Angle"));
hints.push(drag_anchor);
hints
}
PointSelectState::HandleWithPair => {
let mut hints = vec![];
if colinear != ManipulatorAngle::Free {
hints.push(HintInfo::keys([Key::Alt], "Equidistant Handles"));
}
hints.push(HintInfo::keys([Key::Shift], "Snap 15°"));
hints.push(HintInfo::keys([Key::Control], "Lock Angle"));
hints.push(drag_anchor);
hints
}
PointSelectState::Anchor => Vec::new(),
};

if !point_select_state_hint_group.is_empty() {
dragging_hint_data.0.push(HintGroup(point_select_state_hint_group));
if !toggle_group.is_empty() {
dragging_hint_data.0.push(HintGroup(toggle_group));
}

if !hold_group.is_empty() {
dragging_hint_data.0.push(HintGroup(hold_group));
}

dragging_hint_data
Expand Down
Loading
Loading