1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

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
parent 5080126095
commit d140d0f880

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;