public Rect2D(Point2D topLeft, Size2D size) { TopLeft = topLeft; Size = size; }
public Rect2D(Size2D size) : this(new Point2D(0, 0), size) { }
public bool Equals(Size2D other) { return(Equals(this, other)); }
public static bool Equals(Size2D size1, Size2D size2) { return(size1.IsUndefined && size2.IsUndefined || size1.IsEqualWithTolerance(size2)); }
public static Size2D StackVertically(Size2D size1, Size2D size2) { return(new Size2D(Math.Max(size1.Width, size2.Width), size1.Height + size2.Height)); }
public bool IsEqualWithTolerance(Size2D otherSize) { return(Width.IsEqualWithTolerance(otherSize.Width) && Height.IsEqualWithTolerance(otherSize.Height)); }
public Rect2D WithSize(Size2D newSize) => new Rect2D(TopLeft, newSize);