diff --git a/Userland/Applications/PixelPaint/Image.cpp b/Userland/Applications/PixelPaint/Image.cpp index affb256070..03ab22bb52 100644 --- a/Userland/Applications/PixelPaint/Image.cpp +++ b/Userland/Applications/PixelPaint/Image.cpp @@ -22,7 +22,7 @@ namespace PixelPaint { -RefPtr Image::create_with_size(const Gfx::IntSize& size) +RefPtr Image::create_with_size(Gfx::IntSize const& size) { if (size.is_empty()) return nullptr; @@ -33,12 +33,12 @@ RefPtr Image::create_with_size(const Gfx::IntSize& size) return adopt_ref(*new Image(size)); } -Image::Image(const Gfx::IntSize& size) +Image::Image(Gfx::IntSize const& size) : m_size(size) { } -void Image::paint_into(GUI::Painter& painter, const Gfx::IntRect& dest_rect) +void Image::paint_into(GUI::Painter& painter, Gfx::IntRect const& dest_rect) { float scale = (float)dest_rect.width() / (float)rect().width(); Gfx::PainterStateSaver saver(painter); @@ -115,7 +115,7 @@ RefPtr Image::create_from_file(String const& file_path) return create_from_pixel_paint_file(file_path); } -void Image::save(const String& file_path) const +void Image::save(String const& file_path) const { // Build json file StringBuilder builder; @@ -147,7 +147,7 @@ void Image::save(const String& file_path) const fclose(file); } -void Image::export_bmp(const String& file_path) +void Image::export_bmp(String const& file_path) { auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, m_size); GUI::Painter painter(*bitmap); @@ -160,7 +160,7 @@ void Image::export_bmp(const String& file_path) fclose(file); } -void Image::export_png(const String& file_path) +void Image::export_png(String const& file_path) { auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, m_size); VERIFY(bitmap); @@ -194,7 +194,7 @@ RefPtr Image::take_snapshot() const return snapshot; } -void Image::restore_snapshot(const Image& snapshot) +void Image::restore_snapshot(Image const& snapshot) { m_layers.clear(); select_layer(nullptr); @@ -208,7 +208,7 @@ void Image::restore_snapshot(const Image& snapshot) did_modify_layer_stack(); } -size_t Image::index_of(const Layer& layer) const +size_t Image::index_of(Layer const& layer) const { for (size_t i = 0; i < m_layers.size(); ++i) { if (&m_layers.at(i) == &layer) @@ -308,7 +308,7 @@ void Image::remove_client(ImageClient& client) m_clients.remove(&client); } -void Image::layer_did_modify_bitmap(Badge, const Layer& layer) +void Image::layer_did_modify_bitmap(Badge, Layer const& layer) { auto layer_index = index_of(layer); for (auto* client : m_clients) @@ -317,7 +317,7 @@ void Image::layer_did_modify_bitmap(Badge, const Layer& layer) did_change(); } -void Image::layer_did_modify_properties(Badge, const Layer& layer) +void Image::layer_did_modify_properties(Badge, Layer const& layer) { auto layer_index = index_of(layer); for (auto* client : m_clients) diff --git a/Userland/Applications/PixelPaint/Image.h b/Userland/Applications/PixelPaint/Image.h index fbce98efd6..b75cb106b1 100644 --- a/Userland/Applications/PixelPaint/Image.h +++ b/Userland/Applications/PixelPaint/Image.h @@ -36,7 +36,7 @@ protected: class Image : public RefCounted { public: - static RefPtr create_with_size(const Gfx::IntSize&); + static RefPtr create_with_size(Gfx::IntSize const&); static RefPtr create_from_file(String const& file_path); static RefPtr create_from_bitmap(RefPtr bitmap); @@ -49,12 +49,12 @@ public: void add_layer(NonnullRefPtr); RefPtr take_snapshot() const; - void restore_snapshot(const Image&); + void restore_snapshot(Image const&); - void paint_into(GUI::Painter&, const Gfx::IntRect& dest_rect); - void save(const String& file_path) const; - void export_bmp(const String& file_path); - void export_png(const String& file_path); + void paint_into(GUI::Painter&, Gfx::IntRect const& dest_rect); + void save(String const& file_path) const; + void export_bmp(String const& file_path); + void export_png(String const& file_path); void move_layer_to_front(Layer&); void move_layer_to_back(Layer&); @@ -67,8 +67,8 @@ public: void add_client(ImageClient&); void remove_client(ImageClient&); - void layer_did_modify_bitmap(Badge, const Layer&); - void layer_did_modify_properties(Badge, const Layer&); + void layer_did_modify_bitmap(Badge, Layer const&); + void layer_did_modify_properties(Badge, Layer const&); size_t index_of(const Layer&) const;