diff --git a/Userland/Libraries/LibGfx/Point.h b/Userland/Libraries/LibGfx/Point.h index 606a4162c9..545752c9d5 100644 --- a/Userland/Libraries/LibGfx/Point.h +++ b/Userland/Libraries/LibGfx/Point.h @@ -91,6 +91,13 @@ public: return point; } + [[nodiscard]] Point scaled(T dboth) const + { + Point point = *this; + point.scale_by(dboth); + return point; + } + [[nodiscard]] Point scaled(Point const& delta) const { Point point = *this; diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h index 7a48385d28..7f53e7e7a1 100644 --- a/Userland/Libraries/LibGfx/Rect.h +++ b/Userland/Libraries/LibGfx/Rect.h @@ -177,6 +177,13 @@ public: return rect; } + [[nodiscard]] Rect scaled(T dboth) const + { + Rect rect = *this; + rect.scale_by(dboth); + return rect; + } + [[nodiscard]] Rect scaled(T sx, T sy) const { Rect rect = *this;