summaryrefslogtreecommitdiff
path: root/Userland/Applications/PixelPaint/ImageEditor.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-06-11 13:27:47 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-11 22:51:10 +0200
commit29e80178a8b16fe80b489b886d8cd7b6df5f8999 (patch)
tree537f85430e2193523ad6e423e02a9208042c1ac3 /Userland/Applications/PixelPaint/ImageEditor.cpp
parent242742b6c208ae65a55ad714c2b7242636f056a0 (diff)
downloadserenity-29e80178a8b16fe80b489b886d8cd7b6df5f8999.zip
PixelPaint: Convert to east-const style
Diffstat (limited to 'Userland/Applications/PixelPaint/ImageEditor.cpp')
-rw-r--r--Userland/Applications/PixelPaint/ImageEditor.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp
index 9871fd8335..58a1da317b 100644
--- a/Userland/Applications/PixelPaint/ImageEditor.cpp
+++ b/Userland/Applications/PixelPaint/ImageEditor.cpp
@@ -97,12 +97,12 @@ void ImageEditor::paint_event(GUI::PaintEvent& event)
}
}
-Gfx::FloatRect ImageEditor::layer_rect_to_editor_rect(const Layer& layer, const Gfx::IntRect& layer_rect) const
+Gfx::FloatRect ImageEditor::layer_rect_to_editor_rect(Layer const& layer, Gfx::IntRect const& layer_rect) const
{
return image_rect_to_editor_rect(layer_rect.translated(layer.location()));
}
-Gfx::FloatRect ImageEditor::image_rect_to_editor_rect(const Gfx::IntRect& image_rect) const
+Gfx::FloatRect ImageEditor::image_rect_to_editor_rect(Gfx::IntRect const& image_rect) const
{
Gfx::FloatRect editor_rect;
editor_rect.set_location(image_position_to_editor_position(image_rect.location()));
@@ -111,7 +111,7 @@ Gfx::FloatRect ImageEditor::image_rect_to_editor_rect(const Gfx::IntRect& image_
return editor_rect;
}
-Gfx::FloatRect ImageEditor::editor_rect_to_image_rect(const Gfx::IntRect& editor_rect) const
+Gfx::FloatRect ImageEditor::editor_rect_to_image_rect(Gfx::IntRect const& editor_rect) const
{
Gfx::FloatRect image_rect;
image_rect.set_location(editor_position_to_image_position(editor_rect.location()));
@@ -120,12 +120,12 @@ Gfx::FloatRect ImageEditor::editor_rect_to_image_rect(const Gfx::IntRect& editor
return image_rect;
}
-Gfx::FloatPoint ImageEditor::layer_position_to_editor_position(const Layer& layer, const Gfx::IntPoint& layer_position) const
+Gfx::FloatPoint ImageEditor::layer_position_to_editor_position(Layer const& layer, Gfx::IntPoint const& layer_position) const
{
return image_position_to_editor_position(layer_position.translated(layer.location()));
}
-Gfx::FloatPoint ImageEditor::image_position_to_editor_position(const Gfx::IntPoint& image_position) const
+Gfx::FloatPoint ImageEditor::image_position_to_editor_position(Gfx::IntPoint const& image_position) const
{
Gfx::FloatPoint editor_position;
editor_position.set_x(m_editor_image_rect.x() + ((float)image_position.x() * m_scale));
@@ -133,7 +133,7 @@ Gfx::FloatPoint ImageEditor::image_position_to_editor_position(const Gfx::IntPoi
return editor_position;
}
-Gfx::FloatPoint ImageEditor::editor_position_to_image_position(const Gfx::IntPoint& editor_position) const
+Gfx::FloatPoint ImageEditor::editor_position_to_image_position(Gfx::IntPoint const& editor_position) const
{
Gfx::FloatPoint image_position;
image_position.set_x(((float)editor_position.x() - m_editor_image_rect.x()) / m_scale);
@@ -147,7 +147,7 @@ void ImageEditor::second_paint_event(GUI::PaintEvent& event)
m_active_tool->on_second_paint(*m_active_layer, event);
}
-GUI::MouseEvent ImageEditor::event_with_pan_and_scale_applied(const GUI::MouseEvent& event) const
+GUI::MouseEvent ImageEditor::event_with_pan_and_scale_applied(GUI::MouseEvent const& event) const
{
auto image_position = editor_position_to_image_position(event.position());
return {
@@ -160,7 +160,7 @@ GUI::MouseEvent ImageEditor::event_with_pan_and_scale_applied(const GUI::MouseEv
};
}
-GUI::MouseEvent ImageEditor::event_adjusted_for_layer(const GUI::MouseEvent& event, const Layer& layer) const
+GUI::MouseEvent ImageEditor::event_adjusted_for_layer(GUI::MouseEvent const& event, Layer const& layer) const
{
auto image_position = editor_position_to_image_position(event.position());
image_position.translate_by(-layer.location().x(), -layer.location().y());
@@ -309,7 +309,7 @@ Color ImageEditor::color_for(GUI::MouseButton button) const
VERIFY_NOT_REACHED();
}
-Color ImageEditor::color_for(const GUI::MouseEvent& event) const
+Color ImageEditor::color_for(GUI::MouseEvent const& event) const
{
if (event.buttons() & GUI::MouseButton::Left)
return m_primary_color;
@@ -336,7 +336,7 @@ void ImageEditor::set_secondary_color(Color color)
on_secondary_color_change(color);
}
-Layer* ImageEditor::layer_at_editor_position(const Gfx::IntPoint& editor_position)
+Layer* ImageEditor::layer_at_editor_position(Gfx::IntPoint const& editor_position)
{
if (!m_image)
return nullptr;
@@ -360,7 +360,7 @@ void ImageEditor::clamped_scale(float scale_delta)
m_scale = 100.0f;
}
-void ImageEditor::scale_centered_on_position(const Gfx::IntPoint& position, float scale_delta)
+void ImageEditor::scale_centered_on_position(Gfx::IntPoint const& position, float scale_delta)
{
auto old_scale = m_scale;
clamped_scale(scale_delta);