Add support for Vector2i, Rect2i and Vector3i to Variant
WARNING: Requires C++17 'guaranteed copy elision' to fix ambiguous operator problems in Variant. This was added for this commit (and future C++17 uses) in #36457.
This commit is contained in:
parent
a7891b9d12
commit
6da0eef9e6
11 changed files with 1026 additions and 10 deletions
|
|
@ -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); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue