From 89bf12a60abef7c72210e1e3f82318ca53af5ced Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 15 Feb 2019 17:33:48 -0300 Subject: [PATCH] Fix arrow keys to move the selection content Regression introduced in 1c05ea10bb7c6cde8bfc04711ebf104f5b7da658 --- src/app/ui/editor/moving_pixels_state.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/ui/editor/moving_pixels_state.cpp b/src/app/ui/editor/moving_pixels_state.cpp index 74df06bad..06d1dc31f 100644 --- a/src/app/ui/editor/moving_pixels_state.cpp +++ b/src/app/ui/editor/moving_pixels_state.cpp @@ -509,12 +509,15 @@ void MovingPixelsState::onBeforeCommandExecution(CommandExecutionEvent& ev) // We don't need to drop the pixels if a MoveMaskCommand of Content is executed. if (MoveMaskCommand* moveMaskCmd = dynamic_cast(command)) { if (moveMaskCmd->getTarget() == MoveMaskCommand::Content) { - // Do not drop pixels + gfx::Point delta = moveMaskCmd->getMoveThing().getDelta(UIContext::instance()); // Verify Shift condition of the MoveMaskCommand (i.e. wrap = true) if (moveMaskCmd->isWrap()) { - gfx::Point delta = moveMaskCmd->getMoveThing().getDelta(UIContext::instance()); - m_pixelsMovement->shift(delta.x, delta.y); + m_pixelsMovement->shift(delta.x, delta.y); } + else { + translate(delta); + } + // We've processed the selection content movement right here. ev.cancel(); return; }