intersectHorizontal method

bool intersectHorizontal(
  1. IntRect other
)

Checks if this rectangle intersects horizontally with another rectangle.

other The other rectangle to check for horizontal intersection. Returns true if the rectangles overlap horizontally, false otherwise.

Implementation

bool intersectHorizontal(final IntRect other) {
  if (other.left >= right || other.right <= left) {
    // off sides
    return false;
  }
  return true;
}