Exemplo n.º 1
0
 public FixRect(FixRect source)
 {
     this.l = source.l;
     this.t = source.t;
     this.w = source.w;
     this.h = source.h;
 }
Exemplo n.º 2
0
        public override bool Equals(object other)
        {
            if (!(other is FixRect))
            {
                return(false);
            }
            FixRect rect = (FixRect)other;

            return(((this.x.Equals(rect.x) && this.y.Equals(rect.y)) && this.width.Equals(rect.width)) && this.height.Equals(rect.height));
        }
Exemplo n.º 3
0
        public bool Overlaps(FixRect other, bool allowInverse)
        {
            FixRect rect = this;

            if (allowInverse)
            {
                rect  = OrderMinMax(rect);
                other = OrderMinMax(other);
            }
            return(rect.Overlaps(other));
        }
Exemplo n.º 4
0
 private static FixRect OrderMinMax(FixRect rect)
 {
     if (rect.xMin > rect.xMax)
     {
         int xMin = rect.xMin;
         rect.xMin = rect.xMax;
         rect.xMax = xMin;
     }
     if (rect.yMin > rect.yMax)
     {
         int yMin = rect.yMin;
         rect.yMin = rect.yMax;
         rect.yMax = yMin;
     }
     return(rect);
 }
Exemplo n.º 5
0
 public bool Overlaps(FixRect other)
 {
     return((((other.xMax > this.xMin) && (other.xMin < this.xMax)) && (other.yMax > this.yMin)) && (other.yMin < this.yMax));
 }