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