diff options
author | Tim Ledbetter <timledbetter@gmail.com> | 2023-01-13 19:39:54 +0000 |
---|---|---|
committer | Jelle Raaijmakers <jelle@gmta.nl> | 2023-01-15 19:11:25 +0100 |
commit | dd582e4ae3994f98754e255ad8890d0128cf737d (patch) | |
tree | a95fd2d73dc824f003ed4b1fc279575583df7440 /Userland/Applications | |
parent | 431c4165b50f5f456d0fc07d48abb3f2946a308d (diff) | |
download | serenity-dd582e4ae3994f98754e255ad8890d0128cf737d.zip |
PixelPaint: Hold shift to increase move tool speed with the arrow keys
Holding shift while using the move tool with the arrow keys now moves
the selected layer in 10 pixel increments.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/PixelPaint/Tools/MoveTool.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp index bbe9900a6d..1559b93f96 100644 --- a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp @@ -141,7 +141,7 @@ bool MoveTool::on_keydown(GUI::KeyEvent& event) if (m_scaling) return true; - if (event.modifiers() != 0) + if (!(event.modifiers() == Mod_None || event.modifiers() == Mod_Shift)) return false; auto* layer = m_editor->active_layer(); @@ -149,19 +149,19 @@ bool MoveTool::on_keydown(GUI::KeyEvent& event) return false; auto new_location = layer->location(); - + auto speed = event.shift() ? 10 : 1; switch (event.key()) { case Key_Up: - new_location.translate_by(0, -1); + new_location.translate_by(0, -speed); break; case Key_Down: - new_location.translate_by(0, 1); + new_location.translate_by(0, speed); break; case Key_Left: - new_location.translate_by(-1, 0); + new_location.translate_by(-speed, 0); break; case Key_Right: - new_location.translate_by(1, 0); + new_location.translate_by(speed, 0); break; default: return false; |