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