예제 #1
0
 /// <summary>
 /// Creates a rectangle that results from expanding or shrinking the specified rectangle by the specified width and height amounts, in all directions.
 /// </summary>
 public static XRect Inflate(XRect rect, double width, double height)
 {
     rect.Inflate(width, height);
     return(rect);
 }
예제 #2
0
 /// <summary>
 /// Returns the rectangle that results from applying the specified matrix to the specified rectangle.
 /// </summary>
 public static XRect Transform(XRect rect, XMatrix matrix)
 {
     XMatrix.MatrixHelper.TransformRect(ref rect, ref matrix);
     return(rect);
 }
예제 #3
0
 /// <summary>
 /// Returns a rectangle that is offset from the specified rectangle by using specified horizontal and vertical amounts.
 /// </summary>
 public static XRect Offset(XRect rect, double offsetX, double offsetY)
 {
     rect.Offset(offsetX, offsetY);
     return(rect);
 }
예제 #4
0
 /// <summary>
 /// Returns the rectangle that results from expanding the specified rectangle by the specified Size, in all directions.
 /// </summary>
 public static XRect Inflate(XRect rect, XSize size)
 {
     rect.Inflate(size.Width, size.Height);
     return(rect);
 }
예제 #5
0
 /// <summary>
 /// Returns the intersection of a rectangle and a point.
 /// </summary>
 public static XRect Union(XRect rect, XPoint point)
 {
     rect.Union(new XRect(point, point));
     return(rect);
 }
예제 #6
0
 /// <summary>
 /// Returns a rectangle that is offset from the specified rectangle by using the specified vector.
 /// </summary>
 public static XRect Offset(XRect rect, XVector offsetVector)
 {
     rect.Offset(offsetVector.X, offsetVector.Y);
     return(rect);
 }
예제 #7
0
 /// <summary>
 /// Returns the union of two rectangles.
 /// </summary>
 public static XRect Union(XRect rect1, XRect rect2)
 {
     rect1.Union(rect2);
     return(rect1);
 }
예제 #8
0
 /// <summary>
 /// Returns the intersection of two rectangles.
 /// </summary>
 public static XRect Intersect(XRect rect1, XRect rect2)
 {
     rect1.Intersect(rect2);
     return(rect1);
 }
예제 #9
0
 /// <summary>
 /// Indicates whether the specified rectangle intersects with the current rectangle.
 /// </summary>
 public bool IntersectsWith(XRect rect)
 {
     return(!IsEmpty && !rect.IsEmpty &&
            rect.Left <= Right && rect.Right >= Left &&
            rect.Top <= Bottom && rect.Bottom >= Top);
 }
예제 #10
0
 /// <summary>
 /// Indicates whether the rectangle contains the specified rectangle.
 /// </summary>
 public bool Contains(XRect rect)
 {
     return(!IsEmpty && !rect.IsEmpty &&
            _x <= rect._x && _y <= rect._y &&
            _x + _width >= rect._x + rect._width && _y + _height >= rect._y + rect._height);
 }
예제 #11
0
 /// <summary>
 /// Determines whether this instance and the specified rect are equal.
 /// </summary>
 public bool Equals(XRect value)
 {
     return(Equals(this, value));
 }