bool IntRect::Intersects(const IntRect& rect) const { if (!IsValid() || !rect.IsValid()) return false; return !(rect.left > right || rect.right < left || rect.top > bottom || rect.bottom < top); }