public bool IntersectsWith(GpRect rect) { return(GetLeft() < rect.GetRight() && GetTop() < rect.GetBottom() && GetRight() > rect.GetLeft() && GetBottom() > rect.GetTop()); }
static public bool Union(out GpRect c, GpRect a, GpRect b) { int right = Math.Max(a.GetRight(), b.GetRight()); int bottom = Math.Max(a.GetBottom(), b.GetBottom()); int left = Math.Min(a.GetLeft(), b.GetLeft()); int top = Math.Min(a.GetTop(), b.GetTop()); c.X = left; c.Y = top; c.Width = right - left; c.Height = bottom - top; return(!c.IsEmptyArea()); }
static public bool Union(out GpRect c, GpRect a, GpRect b) { int right = Math.Max(a.GetRight(), b.GetRight()); int bottom = Math.Max(a.GetBottom(), b.GetBottom()); int left = Math.Min(a.GetLeft(), b.GetLeft()); int top = Math.Min(a.GetTop(), b.GetTop()); c.X = left; c.Y = top; c.Width = right - left; c.Height = bottom - top; return !c.IsEmptyArea(); }
public bool IntersectsWith(GpRect rect) { return (GetLeft() < rect.GetRight() && GetTop() < rect.GetBottom() && GetRight() > rect.GetLeft() && GetBottom() > rect.GetTop()); }