intersects method

bool intersects(
  1. Rect other
)

Returns whether this rectangle intersects with other.

Implementation

bool intersects(Rect other) {
  return x < other.right &&
      right > other.x &&
      y < other.bottom &&
      bottom > other.y;
}