public void Intersect(Rect other) { if (Empty()) return; x0 = Math.Max(x0, other.x0); y0 = Math.Max(y0, other.y0); x1 = Math.Min(x1, other.x1); y1 = Math.Min(y1, other.y1); }