diff options
Diffstat (limited to 'core/math/math_2d.h')
-rw-r--r-- | core/math/math_2d.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/math/math_2d.h b/core/math/math_2d.h index d788318f5e..60351445c0 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -382,6 +382,11 @@ struct Rect2 { size = end - begin; } + inline Rect2 abs() const { + + return Rect2(Point2(position.x + MIN(size.x, 0), position.y + MIN(size.y, 0)), size.abs()); + } + operator String() const { return String(position) + ", " + String(size); } Rect2() {} |