Fix arrow keys to move the selection content

Regression introduced in 1c05ea10bb
master
David Capello 2019-02-15 17:33:48 -03:00
parent 798d0e9a08
commit 89bf12a60a
1 changed files with 6 additions and 3 deletions

View File

@ -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<MoveMaskCommand*>(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;
}