Fix marquee tool escape deselection (fix #5102)

This commit is contained in:
Joshua Lopez 2025-04-24 22:56:47 -05:00 committed by David Capello
parent 6e9024d54d
commit debab653fa
1 changed files with 4 additions and 5 deletions

View File

@ -470,14 +470,13 @@ bool MovingPixelsState::onKeyDown(Editor* editor, KeyMessage* msg)
if (msg->scancode() == kKeyEnter || // TODO make this key customizable
msg->scancode() == kKeyEnterPad || msg->scancode() == kKeyEsc) {
dropPixels();
// The escape key drop pixels and deselect the mask.
if (msg->scancode() == kKeyEsc) { // TODO make this key customizable
Command* cmd = Commands::instance()->byId(CommandId::DeselectMask());
UIContext::instance()->executeCommandFromMenuOrShortcut(cmd);
m_pixelsMovement->discardImage(PixelsMovement::DontCommitChanges);
m_discarded = true;
}
dropPixels();
return true;
}