diff --git a/Libraries/LibDraw/Rect.h b/Libraries/LibDraw/Rect.h index e496e4de9b..0875859335 100644 --- a/Libraries/LibDraw/Rect.h +++ b/Libraries/LibDraw/Rect.h @@ -200,6 +200,18 @@ public: move_by(0, delta); } + bool intersects_vertically(const Rect& other) const + { + return top() <= other.bottom() + && other.top() <= bottom(); + } + + bool intersects_horizontally(const Rect& other) const + { + return left() <= other.right() + && other.left() <= right(); + } + bool intersects(const Rect& other) const { return left() <= other.right()