Exemple #1
0
 public RectI(RectI source)
 {
     this._minX   = source._minX;
     this._maxY   = source._maxY;
     this._width  = source._width;
     this._height = source._height;
 }
Exemple #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));
 }
Exemple #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));
 }
Exemple #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));
        }
Exemple #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);
        }
Exemple #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)));
        }