diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2022-08-14 21:51:45 -0500 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2022-09-04 23:03:36 -0500 |
commit | 995b9f94e8378b3e1dd81068925e9d34c68445c6 (patch) | |
tree | 673315b285de37ae0d1e361614a5e59641abd9ae /core/math | |
parent | 817ae9566723fd28be9dc5bb199001dc50ca6b54 (diff) |
Replace Rect2(i) has_no_area with has_area
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/rect2.h | 4 | ||||
-rw-r--r-- | core/math/rect2i.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/math/rect2.h b/core/math/rect2.h index 679af933c2..2d1be3d4f3 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -140,8 +140,8 @@ struct _NO_DISCARD_ Rect2 { ((p_rect.position.y + p_rect.size.y) <= (position.y + size.y)); } - _FORCE_INLINE_ bool has_no_area() const { - return (size.x <= 0 || size.y <= 0); + _FORCE_INLINE_ bool has_area() const { + return size.x > 0.0f && size.y > 0.0f; } // Returns the instersection between two Rect2s or an empty Rect2 if there is no intersection diff --git a/core/math/rect2i.h b/core/math/rect2i.h index db1459a3e6..2b58dcdd98 100644 --- a/core/math/rect2i.h +++ b/core/math/rect2i.h @@ -83,8 +83,8 @@ struct _NO_DISCARD_ Rect2i { ((p_rect.position.y + p_rect.size.y) <= (position.y + size.y)); } - _FORCE_INLINE_ bool has_no_area() const { - return (size.x <= 0 || size.y <= 0); + _FORCE_INLINE_ bool has_area() const { + return size.x > 0 && size.y > 0; } // Returns the instersection between two Rect2is or an empty Rect2i if there is no intersection |