intersects method

bool intersects(
  1. Rect<T> other
)

Checks if this rectangle intersects with another rectangle.

  • other: The other rectangle to check intersection with.

Returns true if the rectangles overlap, false otherwise.

Implementation

bool intersects(Rect<T> other) {
  return left < other.right && right > other.left && top < other.bottom && bottom > other.top;
}