mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
PixelPaint: Convert to east-const style
This commit is contained in:
parent
242742b6c2
commit
29e80178a8
23 changed files with 72 additions and 72 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue