mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
Fix switch to/from Artboard tool firing an undo (#1668)
* Fix tool switch causing abort of ArtboardTool transaction when it shouldn't * Add cancellation keyhints * Unify the cancel keyhints with other tools * Consolidate hints --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
fd54cda445
commit
dcce519426
1 changed files with 9 additions and 5 deletions
|
|
@ -404,7 +404,7 @@ impl Fsm for ArtboardToolFsmState {
|
|||
|
||||
ArtboardToolFsmState::Ready
|
||||
}
|
||||
(_, ArtboardToolMessage::Abort) => {
|
||||
(ArtboardToolFsmState::Dragging | ArtboardToolFsmState::Drawing | ArtboardToolFsmState::ResizingBounds, ArtboardToolMessage::Abort) => {
|
||||
responses.add(DocumentMessage::AbortTransaction);
|
||||
|
||||
// ArtboardTool currently doesn't implement snapping
|
||||
|
|
@ -425,10 +425,14 @@ impl Fsm for ArtboardToolFsmState {
|
|||
HintGroup(vec![HintInfo::mouse(MouseMotion::LmbDrag, "Move Artboard")]),
|
||||
HintGroup(vec![HintInfo::keys([Key::Backspace], "Delete Artboard")]),
|
||||
]),
|
||||
ArtboardToolFsmState::Dragging => HintData(vec![HintGroup(vec![HintInfo::keys([Key::Shift], "Constrain to Axis")])]),
|
||||
ArtboardToolFsmState::Drawing | ArtboardToolFsmState::ResizingBounds => {
|
||||
HintData(vec![HintGroup(vec![HintInfo::keys([Key::Shift], "Constrain Square"), HintInfo::keys([Key::Alt], "From Center")])])
|
||||
}
|
||||
ArtboardToolFsmState::Dragging => HintData(vec![
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::Rmb, ""), HintInfo::keys([Key::Escape], "Cancel").prepend_slash()]),
|
||||
HintGroup(vec![HintInfo::keys([Key::Shift], "Constrain to Axis")]),
|
||||
]),
|
||||
ArtboardToolFsmState::Drawing | ArtboardToolFsmState::ResizingBounds => HintData(vec![
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::Rmb, ""), HintInfo::keys([Key::Escape], "Cancel").prepend_slash()]),
|
||||
HintGroup(vec![HintInfo::keys([Key::Shift], "Constrain Square"), HintInfo::keys([Key::Alt], "From Center")]),
|
||||
]),
|
||||
};
|
||||
|
||||
responses.add(FrontendMessage::UpdateInputHints { hint_data });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue