Replace Rect2(i) has_no_area with has_area

This commit is contained in:
Aaron Franke
2022-08-14 21:51:45 -05:00
parent 817ae95667
commit 995b9f94e8
12 changed files with 44 additions and 46 deletions

View File

@ -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

View File

@ -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