diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-02-23 01:38:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-23 01:38:23 +0100 |
commit | 63b0d822d109f3612d5c22e4342ebef9cd3b9163 (patch) | |
tree | 0aa6e9899eb14b5ae5dc8f7b25d03532606c06b2 /core/math/rect2.h | |
parent | f2d8c4eb8b3ecb0f62046e40cc76973e8cccc0fd (diff) | |
parent | 6da0eef9e6695e0da17953d80a1e6b0b673b4678 (diff) |
Merge pull request #36436 from reduz/new-variant-types
Add support for Vector2i, Rect2i and Vector3i to Variant
Diffstat (limited to 'core/math/rect2.h')
-rw-r--r-- | core/math/rect2.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/math/rect2.h b/core/math/rect2.h index 0d2e7eb6e5..e4ea615c22 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -387,6 +387,11 @@ struct Rect2i { size = end - begin; } + _FORCE_INLINE_ Rect2i abs() const { + + return Rect2i(Point2i(position.x + MIN(size.x, 0), position.y + MIN(size.y, 0)), size.abs()); + } + operator String() const { return String(position) + ", " + String(size); } operator Rect2() const { return Rect2(position, size); } |