public Rect(Size size) { if (size.IsEmpty) { this = s_empty; } else { x = y = 0.0f; width = size.Width; height = size.Height; } }
public Rect(Point location, Size size) { if (size.IsEmpty) { this = s_empty; } else { x = location.X; y = location.Y; width = size.Width; height = size.Height; } }
public static Rect Inflate(Rect rect, Size size) { rect.Inflate(size.Width, size.Height); return rect; }
public void Inflate(Size size) { Inflate(size.Width, size.Height); }
public bool Equals(Size other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.width.Equals(width) && other.height.Equals(height); }
public static Size Subtract(Size sz1, Size sz2) { return new Size((sz1.Width - sz2.Width), (sz1.Height - sz2.Height)); }
public static Size Add(Size sz1, Size sz2) { return new Size((sz1.Width + sz2.Width), (sz1.Height + sz2.Height)); }
static Size() { Empty = new Size(0.0f, 0.0f); }
public static Point Subtract(Point pt, Size sz) { return new Point((pt.X - sz.Width), (pt.Y - sz.Height)); }
public static Point Add(Point pt, Size sz) { return new Point(pt.X + sz.Width, pt.Y + sz.Height); }