From 901175d476ae5bfa7d6fd71c6072c63b8d0ee324 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 2 Sep 2022 11:56:07 -0300 Subject: [PATCH] Restore possibility to use Ctrl+Alt to copy selection and snap-to-grid at the same time (fix #3497) If we don't activate Brush Size mouse wheel action when using Ctrl+Alt key modifiers in a selection-like tool we can use Ctrl+Alt to make copies of the selected region and snap-to-grid at the same time. --- src/app/ui/editor/standby_state.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/ui/editor/standby_state.cpp b/src/app/ui/editor/standby_state.cpp index de348741e..6ae1cc377 100644 --- a/src/app/ui/editor/standby_state.cpp +++ b/src/app/ui/editor/standby_state.cpp @@ -497,6 +497,14 @@ bool StandbyState::onKeyDown(Editor* editor, KeyMessage* msg) Keys keys = KeyboardShortcuts::instance() ->getDragActionsFromKeyMessage(KeyContext::MouseWheel, msg); if (!keys.empty()) { + // Don't enter DraggingValueState to change brush size if we are + // in a selection-like tool + if (keys.size() == 1 && + keys[0]->wheelAction() == WheelAction::BrushSize && + editor->getCurrentEditorInk()->isSelection()) { + return false; + } + EditorStatePtr newState(new DraggingValueState(editor, keys)); editor->setState(newState); return true;