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

PixelPaint: Add a Selection class (ImageEditor has a Selection)

This will represent a complex, region-based selection in the future.
For now though, it's just a simple rectangle. :^)
This commit is contained in:
Andreas Kling 2021-06-14 17:36:18 +02:00
parent 96b52f13e4
commit 1b897ec561
6 changed files with 61 additions and 0 deletions

View file

@ -58,6 +58,9 @@ void RectangleSelectTool::on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&
m_selecting = false;
m_editor->update();
auto rect_in_image = Gfx::IntRect::from_two_points(m_selection_start, m_selection_end);
m_editor->selection().set(rect_in_image);
}
void RectangleSelectTool::draw_marching_ants(Gfx::Painter& painter, Gfx::IntRect const& rect) const