intersects method

bool intersects(
  1. GRect rect
)

Determines whether the object specified in the rect parameter intersects with this GRect object.

Implementation

bool intersects(GRect rect) {
  var x0 = x < rect.x ? rect.x : x;
  var x1 = right > rect.right ? rect.right : right;
  if (x1 > x0) {
    var y0 = y < rect.y ? rect.y : y;
    var y1 = bottom > rect.bottom ? rect.bottom : bottom;
    if (y1 > y0) return true;
  }
  return false;
}