1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:47:35 +00:00

PixelPaint: Move selection from ImageEditor to Image

This is preparation for making selection state undoable.
This commit is contained in:
Andreas Kling 2022-08-25 20:50:15 +02:00
parent 67596d9546
commit d571159aeb
8 changed files with 70 additions and 32 deletions

View file

@ -24,7 +24,8 @@ class Tool;
class ImageEditor final
: public GUI::AbstractZoomPanWidget
, public ImageClient {
, public ImageClient
, public SelectionClient {
C_OBJECT(ImageEditor);
public:
@ -71,9 +72,6 @@ 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;
@ -134,6 +132,8 @@ private:
virtual void image_did_change_rect(Gfx::IntRect const&) override;
virtual void image_select_layer(Layer*) override;
virtual void selection_did_change() override;
GUI::MouseEvent event_adjusted_for_layer(GUI::MouseEvent const&, Layer const&) const;
GUI::MouseEvent event_with_pan_and_scale_applied(GUI::MouseEvent const&) const;
@ -173,8 +173,6 @@ private:
Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> m_active_cursor { Gfx::StandardCursor::None };
Selection m_selection;
bool m_loaded_from_image { true };
RefPtr<Core::Timer> m_marching_ants_timer;