& of non-intersecting rectangles is empty

This commit is contained in:
2025-02-10 14:06:48 -06:00
parent 3188f2ed9b
commit d49a96dc03

View File

@@ -106,6 +106,7 @@ bool rectangle::contains(int x, int y) const {
} }
bool rectangle::empty() const { bool rectangle::empty() const {
if(right < left || bottom < top) return true;
return height() == 0 && width() == 0; return height() == 0 && width() == 0;
} }