mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:27:35 +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:
parent
96b52f13e4
commit
1b897ec561
6 changed files with 61 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "Image.h"
|
||||
#include "Selection.h"
|
||||
#include <LibGUI/Frame.h>
|
||||
#include <LibGUI/UndoStack.h>
|
||||
#include <LibGfx/Point.h>
|
||||
|
@ -53,6 +54,9 @@ public:
|
|||
Color secondary_color() const { return m_secondary_color; }
|
||||
void set_secondary_color(Color);
|
||||
|
||||
Selection& selection() { return m_selection; }
|
||||
Selection const& selection() const { return m_selection; }
|
||||
|
||||
Color color_for(GUI::MouseEvent const&) const;
|
||||
Color color_for(GUI::MouseButton) const;
|
||||
|
||||
|
@ -105,6 +109,8 @@ private:
|
|||
Gfx::FloatPoint m_pan_origin;
|
||||
Gfx::FloatPoint m_saved_pan_origin;
|
||||
Gfx::IntPoint m_click_position;
|
||||
|
||||
Selection m_selection;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue