LibGfx: Add Rect::translated(dboth)

This corresponds to the current in place Rect::translate_by(dboth).
This commit is contained in:
MacDue 2022-12-26 22:03:02 +00:00 committed by Andreas Kling
commit d140d0f880
Notes: sideshowbarker 2024-07-17 02:14:23 +09:00

View file

@ -168,6 +168,13 @@ public:
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
{
Rect<T> rect = *this;