示例#1
0
 public bool IntersectsWith(GpRect rect)
 {
     return(GetLeft() < rect.GetRight() &&
            GetTop() < rect.GetBottom() &&
            GetRight() > rect.GetLeft() &&
            GetBottom() > rect.GetTop());
 }
示例#2
0
        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());
        }
示例#3
0
    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();
    }
示例#4
0
 public bool IntersectsWith(GpRect rect)
 {
     return (GetLeft() < rect.GetRight() &&
             GetTop() < rect.GetBottom() &&
             GetRight() > rect.GetLeft() &&
             GetBottom() > rect.GetTop());
 }