mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:17:35 +00:00
PixelPaint: No need to pass ImageEditor& to Selection::paint()
It already has a reference to the editor in m_editor.
This commit is contained in:
parent
e6f27cec39
commit
fa7bb98b1e
3 changed files with 4 additions and 4 deletions
|
@ -98,7 +98,7 @@ void ImageEditor::paint_event(GUI::PaintEvent& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_selection.is_empty())
|
if (!m_selection.is_empty())
|
||||||
m_selection.paint(painter, *this);
|
m_selection.paint(painter);
|
||||||
}
|
}
|
||||||
|
|
||||||
Gfx::FloatRect ImageEditor::layer_rect_to_editor_rect(Layer const& layer, Gfx::IntRect const& layer_rect) const
|
Gfx::FloatRect ImageEditor::layer_rect_to_editor_rect(Layer const& layer, Gfx::IntRect const& layer_rect) const
|
||||||
|
|
|
@ -12,9 +12,9 @@ namespace PixelPaint {
|
||||||
|
|
||||||
constexpr int marching_ant_length = 4;
|
constexpr int marching_ant_length = 4;
|
||||||
|
|
||||||
void Selection::paint(Gfx::Painter& painter, ImageEditor const& editor)
|
void Selection::paint(Gfx::Painter& painter)
|
||||||
{
|
{
|
||||||
draw_marching_ants(painter, editor.image_rect_to_editor_rect(m_rect).to_type<int>());
|
draw_marching_ants(painter, m_editor.image_rect_to_editor_rect(m_rect).to_type<int>());
|
||||||
}
|
}
|
||||||
|
|
||||||
Selection::Selection(ImageEditor& editor)
|
Selection::Selection(ImageEditor& editor)
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
void set(Gfx::IntRect const& rect) { m_rect = rect; }
|
void set(Gfx::IntRect const& rect) { m_rect = rect; }
|
||||||
Gfx::IntRect bounding_rect() const { return m_rect; }
|
Gfx::IntRect bounding_rect() const { return m_rect; }
|
||||||
|
|
||||||
void paint(Gfx::Painter&, ImageEditor const&);
|
void paint(Gfx::Painter&);
|
||||||
|
|
||||||
void draw_marching_ants(Gfx::Painter&, Gfx::IntRect const&) const;
|
void draw_marching_ants(Gfx::Painter&, Gfx::IntRect const&) const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue