Beispiel #1
0
 public RectI(RectI source)
 {
     this._minX   = source._minX;
     this._maxY   = source._maxY;
     this._width  = source._width;
     this._height = source._height;
 }
Beispiel #2
0
 public void Intersects(ref RectI value, out bool result)
 {
     result = (((value.X < (this.X + this.Width)) &&
                (this.X < (value.X + value.Width))) &&
               (value.Y < (this.Y + this.Height))) &&
              (this.Y < (value.Y + value.Height));
 }
Beispiel #3
0
 public void Contains(ref RectI value, out bool result)
 {
     result = (((this.X <= value.X) &&
                ((value.X + value.Width) <= (this.X + this.Width))) &&
               (this.Y <= value.Y)) &&
              ((value.Y + value.Height) <= (this.Y + this.Height));
 }
Beispiel #4
0
        public override bool Equals(object other)
        {
            if (!(other is RectI))
            {
                return(false);
            }

            RectI rect = (RectI)other;

            return(((this.X.Equals(rect.X) && this.Y.Equals(rect.Y)) && this.Width.Equals(rect.Width)) && this.Height.Equals(rect.Height));
        }
Beispiel #5
0
        public ContainmentType Contains(RectI rect)
        {
            var result = ContainmentType.Outside;

            if (((MaxX >= MinX) && (MinX <= rect.MaxX)) &&
                ((MaxY >= rect.MaxY) && (MinY <= rect.MaxY)))
            {
                result = (((MinX <= rect.MinX) && (rect.MaxX <= MaxX)) &&
                          ((MinY <= rect.MinY) && (rect.MaxY <= MaxY)))
                    ? ContainmentType.Inside
                    : ContainmentType.Intersect;
            }

            return(result);
        }
Beispiel #6
0
        public bool Intersects(RectI value)
        {
            if ((MaxX < value.MinX) || (MinX > value.MaxX))
            {
                return(false);
            }

            if ((MaxY < value.MinY) || (MinY > value.MaxY))
            {
                return(false);
            }

            return(true);

            //return (((this.MinX <= value.MaxX) && (this.MaxX >= value.MinX)) && ((this.MinY <= value.MaxY) && (this.MaxY >= value.MinY)));
        }