mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
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.
This commit is contained in:
parent
431c4165b5
commit
dd582e4ae3
Notes:
sideshowbarker
2024-07-17 01:39:20 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/dd582e4ae3 Pull-request: https://github.com/SerenityOS/serenity/pull/16998 Reviewed-by: https://github.com/gmta ✅
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue