diff --git a/src/app/ui/editor/moving_pixels_state.cpp b/src/app/ui/editor/moving_pixels_state.cpp index d9d3dfe3d..6dfe4db5b 100644 --- a/src/app/ui/editor/moving_pixels_state.cpp +++ b/src/app/ui/editor/moving_pixels_state.cpp @@ -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; }