diff options
author | Andreas Kling <kling@serenityos.org> | 2021-06-14 17:36:18 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-14 18:25:17 +0200 |
commit | 1b897ec561f4731353a025ec028e1fbab7f335a2 (patch) | |
tree | d015885fe1a9465a99c7eab53cc80d71abbdff97 /Userland/Applications/PixelPaint/RectangleSelectTool.cpp | |
parent | 96b52f13e47a33321c13308c5b2b7690fad2d488 (diff) | |
download | serenity-1b897ec561f4731353a025ec028e1fbab7f335a2.zip |
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. :^)
Diffstat (limited to 'Userland/Applications/PixelPaint/RectangleSelectTool.cpp')
-rw-r--r-- | Userland/Applications/PixelPaint/RectangleSelectTool.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/RectangleSelectTool.cpp b/Userland/Applications/PixelPaint/RectangleSelectTool.cpp index 6a9dc62e69..820bb4219f 100644 --- a/Userland/Applications/PixelPaint/RectangleSelectTool.cpp +++ b/Userland/Applications/PixelPaint/RectangleSelectTool.cpp @@ -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 |