Skip to content

Commit 89bf12a

Browse files
committed
Fix arrow keys to move the selection content
Regression introduced in 1c05ea1
1 parent 798d0e9 commit 89bf12a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/app/ui/editor/moving_pixels_state.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,15 @@ void MovingPixelsState::onBeforeCommandExecution(CommandExecutionEvent& ev)
509509
// We don't need to drop the pixels if a MoveMaskCommand of Content is executed.
510510
if (MoveMaskCommand* moveMaskCmd = dynamic_cast<MoveMaskCommand*>(command)) {
511511
if (moveMaskCmd->getTarget() == MoveMaskCommand::Content) {
512-
// Do not drop pixels
512+
gfx::Point delta = moveMaskCmd->getMoveThing().getDelta(UIContext::instance());
513513
// Verify Shift condition of the MoveMaskCommand (i.e. wrap = true)
514514
if (moveMaskCmd->isWrap()) {
515-
gfx::Point delta = moveMaskCmd->getMoveThing().getDelta(UIContext::instance());
516-
m_pixelsMovement->shift(delta.x, delta.y);
515+
m_pixelsMovement->shift(delta.x, delta.y);
517516
}
517+
else {
518+
translate(delta);
519+
}
520+
// We've processed the selection content movement right here.
518521
ev.cancel();
519522
return;
520523
}

0 commit comments

Comments
 (0)