1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 10:57:36 +00:00

Meta+Userland: Pass Gfx::IntPoint by value

This is just two ints or 8 bytes or the size of the reference on
x86_64 or AArch64.
This commit is contained in:
MacDue 2022-12-06 20:27:44 +00:00 committed by Andreas Kling
parent bbc149ebb9
commit 7be0b27dd3
161 changed files with 442 additions and 441 deletions

View file

@ -128,7 +128,7 @@ void CatDog::paint_event(GUI::PaintEvent& event)
painter.blit(Gfx::IntPoint(0, 0), *m_curr_bmp, m_curr_bmp->rect());
}
void CatDog::track_mouse_move(Gfx::IntPoint const& point)
void CatDog::track_mouse_move(Gfx::IntPoint point)
{
if (!m_roaming)
return;

View file

@ -37,7 +37,7 @@ public:
virtual void timer_event(Core::TimerEvent&) override;
virtual void paint_event(GUI::PaintEvent& event) override;
virtual void track_mouse_move(Gfx::IntPoint const& point) override;
virtual void track_mouse_move(Gfx::IntPoint point) override;
virtual void mousedown_event(GUI::MouseEvent& event) override;
virtual void context_menu_event(GUI::ContextMenuEvent& event) override;

View file

@ -11,7 +11,7 @@
#include <LibGUI/Window.h>
#include <LibGfx/Palette.h>
void EyesWidget::track_mouse_move(Gfx::IntPoint const& point)
void EyesWidget::track_mouse_move(Gfx::IntPoint point)
{
m_mouse_position = point - window()->position();
update();

View file

@ -37,7 +37,7 @@ private:
}
virtual void paint_event(GUI::PaintEvent&) override;
virtual void track_mouse_move(Gfx::IntPoint const&) override;
virtual void track_mouse_move(Gfx::IntPoint) override;
void render_eyeball(int row, int column, Gfx::AntiAliasingPainter& aa_painter) const;
Gfx::IntPoint pupil_center(Gfx::IntRect& eyeball_bounds) const;

View file

@ -55,7 +55,7 @@ public:
calculate();
}
void pan_by(Gfx::IntPoint const& delta)
void pan_by(Gfx::IntPoint delta)
{
auto relative_width_pixel = (m_x_end - m_x_start) / m_bitmap->width();
auto relative_height_pixel = (m_y_end - m_y_start) / m_bitmap->height();
@ -179,7 +179,7 @@ private:
m_y_end = y_mid + aspect_corrected_y_length / 2;
}
void move_contents_by(Gfx::IntPoint const& delta)
void move_contents_by(Gfx::IntPoint delta)
{
// If we're moving down we paint upwards, else we paint downwards, to
// avoid overwriting.
@ -223,7 +223,7 @@ class Mandelbrot : public GUI::Frame {
In,
Out,
};
void zoom(Zoom in_out, Gfx::IntPoint const& center);
void zoom(Zoom in_out, Gfx::IntPoint center);
void reset();
@ -247,7 +247,7 @@ private:
MandelbrotSet m_set;
};
void Mandelbrot::zoom(Zoom in_out, Gfx::IntPoint const& center)
void Mandelbrot::zoom(Zoom in_out, Gfx::IntPoint center)
{
static constexpr double zoom_in_multiplier = 0.8;
static constexpr double zoom_out_multiplier = 1.25;