示例#1
0
 public RectI(RectI clone)
 {
     _x      = clone.X;
     _y      = clone.Y;
     _width  = clone.Width;
     _height = clone.Height;
 }
示例#2
0
 public bool Contains(RectI rect)
 {
     return
         (Contains(rect.TopLeft) &&
          Contains(rect.TopRight) &&
          Contains(rect.BottomLeft) &&
          Contains(rect.BottomRight));
 }
示例#3
0
        /// <summary>
        /// Create a new rectangle, inflated by <paramref name="x"/> and <paramref name="y"/>.
        /// </summary>
        public RectI Inflate(int x, int y)
        {
            var newRect = new RectI(this);

            newRect.Left   -= x;
            newRect.Right  += x;
            newRect.Top    -= y;
            newRect.Bottom += y;
            return(newRect);
        }