mirror of
https://github.com/aseprite/aseprite.git
synced 2024-11-20 14:21:45 +00:00
Fix changing brush size w/drag value when multiple editors are opened (fix #3884)
This fixes unnecessary propagation of kKeyDownMessage/kKeyUpMessage messages across all open editors. The pressed key should be sent to the active editor or the one with the mouse over it.
This commit is contained in:
parent
fc24613b81
commit
a628bbb58b
@ -2078,13 +2078,13 @@ bool Editor::onProcessMessage(Message* msg)
|
||||
}
|
||||
#endif // ENABLE_DEVMODE
|
||||
|
||||
if (m_sprite) {
|
||||
if (m_sprite && (isActive() || hasMouse())) {
|
||||
EditorStatePtr holdState(m_state);
|
||||
bool used = m_state->onKeyDown(this, static_cast<KeyMessage*>(msg));
|
||||
|
||||
updateToolLoopModifiersIndicators();
|
||||
updateAutoCelGuides(msg);
|
||||
if (hasMouse()) {
|
||||
updateToolLoopModifiersIndicators();
|
||||
updateAutoCelGuides(msg);
|
||||
updateQuicktool();
|
||||
setCursor(mousePosInDisplay());
|
||||
}
|
||||
@ -2095,13 +2095,13 @@ bool Editor::onProcessMessage(Message* msg)
|
||||
break;
|
||||
|
||||
case kKeyUpMessage:
|
||||
if (m_sprite) {
|
||||
if (m_sprite && (isActive() || hasMouse())) {
|
||||
EditorStatePtr holdState(m_state);
|
||||
bool used = m_state->onKeyUp(this, static_cast<KeyMessage*>(msg));
|
||||
|
||||
updateToolLoopModifiersIndicators();
|
||||
updateAutoCelGuides(msg);
|
||||
if (hasMouse()) {
|
||||
updateToolLoopModifiersIndicators();
|
||||
updateAutoCelGuides(msg);
|
||||
updateQuicktool();
|
||||
setCursor(mousePosInDisplay());
|
||||
}
|
||||
|
@ -498,7 +498,7 @@ bool StandbyState::onKeyDown(Editor* editor, KeyMessage* msg)
|
||||
|
||||
Keys keys = KeyboardShortcuts::instance()
|
||||
->getDragActionsFromKeyMessage(KeyContext::MouseWheel, msg);
|
||||
if (!keys.empty()) {
|
||||
if (editor->hasMouse() && !keys.empty()) {
|
||||
// Don't enter DraggingValueState to change brush size if we are
|
||||
// in a selection-like tool
|
||||
if (keys.size() == 1 &&
|
||||
|
Loading…
Reference in New Issue
Block a user