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.
This commit is contained in:
David Capello 2022-09-02 11:56:07 -03:00
parent 87a68b0a81
commit 901175d476

View File

@ -497,6 +497,14 @@ bool StandbyState::onKeyDown(Editor* editor, KeyMessage* msg)
Keys keys = KeyboardShortcuts::instance() Keys keys = KeyboardShortcuts::instance()
->getDragActionsFromKeyMessage(KeyContext::MouseWheel, msg); ->getDragActionsFromKeyMessage(KeyContext::MouseWheel, msg);
if (!keys.empty()) { 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)); EditorStatePtr newState(new DraggingValueState(editor, keys));
editor->setState(newState); editor->setState(newState);
return true; return true;