1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

PixelPaint: Always animate marching ants during interactive selection

The Selection object now tracks whether there is an ongoing interactive
selection (originating from one of the selection tools). If so it makes
sure to pump the marching ants animation.
This commit is contained in:
Andreas Kling 2021-06-14 18:06:50 +02:00
parent f54164e8ae
commit 068ca3a394
3 changed files with 9 additions and 1 deletions

View file

@ -25,6 +25,8 @@ void RectangleSelectTool::on_mousedown(Layer&, GUI::MouseEvent&, GUI::MouseEvent
return;
m_selecting = true;
m_editor->selection().begin_interactive_selection();
m_selection_start = image_event.position();
m_selection_end = image_event.position();
m_editor->update();
@ -45,6 +47,8 @@ void RectangleSelectTool::on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&
return;
m_selecting = false;
m_editor->selection().end_interactive_selection();
m_editor->update();
auto rect_in_image = Gfx::IntRect::from_two_points(m_selection_start, m_selection_end);