From fa7bb98b1ef18ae32d65ae071d0ee06ac87082d9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 14 Jun 2021 21:27:31 +0200 Subject: [PATCH] PixelPaint: No need to pass ImageEditor& to Selection::paint() It already has a reference to the editor in m_editor. --- Userland/Applications/PixelPaint/ImageEditor.cpp | 2 +- Userland/Applications/PixelPaint/Selection.cpp | 4 ++-- Userland/Applications/PixelPaint/Selection.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index 2d4d8e7a42..cf4b50e765 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -98,7 +98,7 @@ void ImageEditor::paint_event(GUI::PaintEvent& event) } 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 diff --git a/Userland/Applications/PixelPaint/Selection.cpp b/Userland/Applications/PixelPaint/Selection.cpp index cd5d32f235..5d64a0c709 100644 --- a/Userland/Applications/PixelPaint/Selection.cpp +++ b/Userland/Applications/PixelPaint/Selection.cpp @@ -12,9 +12,9 @@ namespace PixelPaint { 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()); + draw_marching_ants(painter, m_editor.image_rect_to_editor_rect(m_rect).to_type()); } Selection::Selection(ImageEditor& editor) diff --git a/Userland/Applications/PixelPaint/Selection.h b/Userland/Applications/PixelPaint/Selection.h index bdcf299d12..8e4d729e74 100644 --- a/Userland/Applications/PixelPaint/Selection.h +++ b/Userland/Applications/PixelPaint/Selection.h @@ -23,7 +23,7 @@ public: void set(Gfx::IntRect const& rect) { m_rect = 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;