summaryrefslogtreecommitdiff
path: root/Userland/Applications/PixelPaint
diff options
context:
space:
mode:
authorJagger De Leo <jagger@suborbital.dev>2022-01-31 22:53:52 -0500
committerAndreas Kling <kling@serenityos.org>2022-02-04 16:11:48 +0100
commitd5183cb7acbfe0a5cb8bfd44056f57bc7415a6f0 (patch)
treed22ea22afa430625a6f3911354548b853facef50 /Userland/Applications/PixelPaint
parenta96b15d2bc3d3a82134374b4891ef19dfcf99604 (diff)
downloadserenity-d5183cb7acbfe0a5cb8bfd44056f57bc7415a6f0.zip
PixelPaint: Use Escape to clear rectangular selections
Now while dragging a new rectangular selection you can cancel it by hitting Escape. Existing selections are cleared by Escape as well if the RectangularSelectTool is active.
Diffstat (limited to 'Userland/Applications/PixelPaint')
-rw-r--r--Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp
index fa52524495..559be8ae9a 100644
--- a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp
+++ b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp
@@ -115,6 +115,13 @@ void RectangleSelectTool::on_keydown(GUI::KeyEvent& key_event)
m_moving_mode = MovingMode::MovingOrigin;
else if (key_event.key() == KeyCode::Key_Control)
m_moving_mode = MovingMode::AroundCenter;
+
+ if (key_event.key() == KeyCode::Key_Escape) {
+ if (m_selecting)
+ m_selecting = false;
+ else
+ m_editor->selection().clear();
+ }
}
void RectangleSelectTool::on_keyup(GUI::KeyEvent& key_event)