public static Rect InflateNew(Rect rect, double width, double height) { var r = new Rect(rect._x, rect._y, rect._width, rect._height); r.Inflate(width, height); return r; }
public static Rect Inflate(Rect rect, double width, double height) { rect.Inflate(width, height); return rect; }
static Rect() { SEmpty = CreateEmptyRect(); }
public static Rect Inflate(Rect rect, Size size) { rect.Inflate(size._width, size._height); return rect; }
public static Rect Union(Rect rect, Point point) { rect.Union(new Rect(point, point)); return rect; }
public bool Contains(Rect rect) { if (IsEmpty || rect.IsEmpty) { return false; } return ((((_x <= rect._x) && (_y <= rect._y)) && ((_x + _width) >= (rect._x + rect._width))) && ((_y + _height) >= (rect._y + rect._height))); }
public void Union(Rect rect) { if (IsEmpty) { _x = 0; _y = 0; _width = 0; _height = 0; } else if (!rect.IsEmpty) { double num2 = Math.Min(Left, rect.Left); double num = Math.Min(Top, rect.Top); if ((rect.Width == double.PositiveInfinity) || (Width == double.PositiveInfinity)) { _width = double.PositiveInfinity; } else { double num4 = Math.Max(Right, rect.Right); _width = Math.Max(num4 - num2, 0.0); } if ((rect.Height == double.PositiveInfinity) || (Height == double.PositiveInfinity)) { _height = double.PositiveInfinity; } else { double num3 = Math.Max(Bottom, rect.Bottom); _height = Math.Max(num3 - num, 0.0); } _x = num2; _y = num; } }
public static Rect Union(Rect rect1, Rect rect2) { rect1.Union(rect2); return rect1; }
public void Intersect(Rect rect) { if (!IntersectsWith(rect)) { _x = 0; _y = 0; _width = 0; _height = 0; } else { var num2 = Math.Max(Left, rect.Left); var num = Math.Max(Top, rect.Top); _width = Math.Max(Math.Min(Right, rect.Right) - num2, 0.0); _height = Math.Max(Math.Min(Bottom, rect.Bottom) - num, 0.0); _x = num2; _y = num; } }
public static Rect Intersect(Rect rect1, Rect rect2) { rect1.Intersect(rect2); return rect1; }
public bool IntersectsWith(Rect rect) { if (IsEmpty || rect.IsEmpty) { return false; } return ((((rect.Left <= Right) && (rect.Right >= Left)) && (rect.Top <= Bottom)) && (rect.Bottom >= Top)); }
public static Rect Offset(Rect rect, double offsetX, double offsetY) { rect.Offset(offsetX, offsetY); return rect; }
public static Rect Offset(Rect rect, Vector offsetVector) { rect.Offset(offsetVector.X, offsetVector.Y); return rect; }
public bool Equals(Rect value) { return Equals(this, value); }
public static bool Equals(Rect rect1, Rect rect2) { if (rect1.IsEmpty) { return rect2.IsEmpty; } return (((rect1.X.Equals(rect2.X) && rect1.Y.Equals(rect2.Y)) && rect1.Width.Equals(rect2.Width)) && rect1.Height.Equals(rect2.Height)); }