intersects 方法

bool intersects(
  1. Rectangle<num> other
)

返回true,如果当前对象与other相交。

实现

bool intersects(Rectangle<num> other) {
  return (left <= other.left + other.width &&
      other.left <= left + width &&
      top <= other.top + other.height &&
      other.top <= top + height);
}