From 7be0b27dd3cd7185c1b8dc52747c50aad479bc6a Mon Sep 17 00:00:00 2001 From: MacDue Date: Tue, 6 Dec 2022 20:27:44 +0000 Subject: 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. --- Userland/Libraries/LibGUI/Widget.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Userland/Libraries/LibGUI/Widget.h') diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index d0a94584d3..0c374f877b 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -240,8 +240,8 @@ public: WeakPtr widget; Gfx::IntPoint local_position; }; - HitTestResult hit_test(Gfx::IntPoint const&, ShouldRespectGreediness = ShouldRespectGreediness::Yes); - Widget* child_at(Gfx::IntPoint const&) const; + HitTestResult hit_test(Gfx::IntPoint, ShouldRespectGreediness = ShouldRespectGreediness::Yes); + Widget* child_at(Gfx::IntPoint) const; void set_relative_rect(Gfx::IntRect const&); void set_relative_rect(int x, int y, int width, int height) { set_relative_rect({ x, y, width, height }); } @@ -251,13 +251,13 @@ public: void set_width(int width) { set_relative_rect(x(), y(), width, height()); } void set_height(int height) { set_relative_rect(x(), y(), width(), height); } - void move_to(Gfx::IntPoint const& point) { set_relative_rect({ point, relative_rect().size() }); } + void move_to(Gfx::IntPoint point) { set_relative_rect({ point, relative_rect().size() }); } void move_to(int x, int y) { move_to({ x, y }); } void resize(Gfx::IntSize const& size) { set_relative_rect({ relative_rect().location(), size }); } void resize(int width, int height) { resize({ width, height }); } void move_by(int x, int y) { move_by({ x, y }); } - void move_by(Gfx::IntPoint const& delta) { set_relative_rect({ relative_position().translated(delta), size() }); } + void move_by(Gfx::IntPoint delta) { set_relative_rect({ relative_position().translated(delta), size() }); } Gfx::ColorRole background_role() const { return m_background_role; } void set_background_role(Gfx::ColorRole); -- cgit v1.2.3