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