1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

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.
This commit is contained in:
Jagger De Leo 2022-01-31 22:53:52 -05:00 committed by Andreas Kling
parent a96b15d2bc
commit d5183cb7ac

View file

@ -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)