Parcourir la source

LibGfx: Add Rect::translated(dboth)

This corresponds to the current in place Rect::translate_by(dboth).
MacDue il y a 2 ans
Parent
commit
d140d0f880
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      Userland/Libraries/LibGfx/Rect.h

+ 7 - 0
Userland/Libraries/LibGfx/Rect.h

@@ -168,6 +168,13 @@ public:
         return rect;
         return rect;
     }
     }
 
 
+    [[nodiscard]] Rect<T> translated(T dboth) const
+    {
+        Rect<T> rect = *this;
+        rect.translate_by(dboth);
+        return rect;
+    }
+
     [[nodiscard]] Rect<T> translated(Point<T> const& delta) const
     [[nodiscard]] Rect<T> translated(Point<T> const& delta) const
     {
     {
         Rect<T> rect = *this;
         Rect<T> rect = *this;