예제 #1
0
 public FixRect(FixRect source)
 {
     this.l = source.l;
     this.t = source.t;
     this.w = source.w;
     this.h = source.h;
 }
예제 #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));
        }
예제 #3
0
        public bool Overlaps(FixRect other, bool allowInverse)
        {
            FixRect rect = this;

            if (allowInverse)
            {
                rect  = OrderMinMax(rect);
                other = OrderMinMax(other);
            }
            return(rect.Overlaps(other));
        }
예제 #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);
 }
예제 #5
0
 public bool Overlaps(FixRect other)
 {
     return((((other.xMax > this.xMin) && (other.xMin < this.xMax)) && (other.yMax > this.yMin)) && (other.yMin < this.yMax));
 }