From d140d0f8803a3a96249b350e7c15aaa8e37d0503 Mon Sep 17 00:00:00 2001 From: MacDue Date: Mon, 26 Dec 2022 22:03:02 +0000 Subject: [PATCH] LibGfx: Add Rect::translated(dboth) This corresponds to the current in place Rect::translate_by(dboth). --- Userland/Libraries/LibGfx/Rect.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h index 0c02cff68c..43b549c1e6 100644 --- a/Userland/Libraries/LibGfx/Rect.h +++ b/Userland/Libraries/LibGfx/Rect.h @@ -168,6 +168,13 @@ public: return rect; } + [[nodiscard]] Rect translated(T dboth) const + { + Rect rect = *this; + rect.translate_by(dboth); + return rect; + } + [[nodiscard]] Rect translated(Point const& delta) const { Rect rect = *this;