/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <summary> /// Returns the union of two rectangles. /// </summary> public static XRect Union(XRect rect1, XRect rect2) { rect1.Union(rect2); return(rect1); }
/// <summary> /// Returns the intersection of two rectangles. /// </summary> public static XRect Intersect(XRect rect1, XRect rect2) { rect1.Intersect(rect2); return(rect1); }
/// <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); }
/// <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); }
/// <summary> /// Determines whether this instance and the specified rect are equal. /// </summary> public bool Equals(XRect value) { return(Equals(this, value)); }