Exemplo n.º 1
0
 public void Set(RectBox.Rect2i src)
 {
     this.left   = src.left;
     this.top    = src.top;
     this.right  = src.right;
     this.bottom = src.bottom;
 }
Exemplo n.º 2
0
 public Rect2i(RectBox.Rect2i r)
 {
     left   = r.left;
     top    = r.top;
     right  = r.right;
     bottom = r.bottom;
 }
Exemplo n.º 3
0
 public override bool Equals(object obj)
 {
     RectBox.Rect2i r = (RectBox.Rect2i)obj;
     if (r != null)
     {
         return(left == r.left && top == r.top && right == r.right &&
                bottom == r.bottom);
     }
     return(false);
 }
Exemplo n.º 4
0
 public bool SetIntersect(RectBox.Rect2i a, RectBox.Rect2i b)
 {
     if (a.left < b.right && b.left < a.right && a.top < b.bottom &&
         b.top < a.bottom)
     {
         left   = MathUtils.Max(a.left, b.left);
         top    = MathUtils.Max(a.top, b.top);
         right  = MathUtils.Min(a.right, b.right);
         bottom = MathUtils.Min(a.bottom, b.bottom);
         return(true);
     }
     return(false);
 }
Exemplo n.º 5
0
 public void Union(RectBox.Rect2i r)
 {
     Union(r.left, r.top, r.right, r.bottom);
 }
Exemplo n.º 6
0
 public static bool Intersects(RectBox.Rect2i a, RectBox.Rect2i b)
 {
     return(a.left < b.right && b.left < a.right && a.top < b.bottom &&
            b.top < a.bottom);
 }
Exemplo n.º 7
0
 public bool Intersect(RectBox.Rect2i r)
 {
     return(Intersect(r.left, r.top, r.right, r.bottom));
 }
Exemplo n.º 8
0
 public bool Contains(RectBox.Rect2i r)
 {
     return(this.left < this.right && this.top < this.bottom &&
            left <= r.left && top <= r.top && right >= r.right &&
            bottom >= r.bottom);
 }