mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:17:35 +00:00
PixelPaint: Move "marching ants" painting logic to ImageEditor
Since this code needs to look at a bunch of ImageEditor state anyway, it makes more sense for it to live in ImageEditor.
This commit is contained in:
parent
e6d860f2fe
commit
67596d9546
5 changed files with 116 additions and 108 deletions
|
@ -113,6 +113,9 @@ public:
|
|||
|
||||
bool is_modified();
|
||||
|
||||
void draw_marching_ants(Gfx::Painter&, Gfx::IntRect const&) const;
|
||||
void draw_marching_ants(Gfx::Painter&, Mask const&) const;
|
||||
|
||||
private:
|
||||
explicit ImageEditor(NonnullRefPtr<Image>);
|
||||
|
||||
|
@ -140,6 +143,8 @@ private:
|
|||
Gfx::IntRect mouse_indicator_rect_x() const;
|
||||
Gfx::IntRect mouse_indicator_rect_y() const;
|
||||
|
||||
void paint_selection(Gfx::Painter&);
|
||||
|
||||
NonnullRefPtr<Image> m_image;
|
||||
RefPtr<Layer> m_active_layer;
|
||||
GUI::UndoStack m_undo_stack;
|
||||
|
@ -171,6 +176,11 @@ private:
|
|||
Selection m_selection;
|
||||
|
||||
bool m_loaded_from_image { true };
|
||||
|
||||
RefPtr<Core::Timer> m_marching_ants_timer;
|
||||
int m_marching_ants_offset { 0 };
|
||||
|
||||
void draw_marching_ants_pixel(Gfx::Painter&, int x, int y) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue