예제 #1
0
 public RectangleInt2 Inflate(VectorInt2 width) =>
 new RectangleInt2(Start - width, End + width);
예제 #2
0
 public static RectangleInt2 FromLTRB(VectorInt2 start, VectorInt2 size) => new RectangleInt2(start, start + size);
예제 #3
0
 public bool Contains(VectorInt2 point) =>
 Start.X <= point.X && End.X >= point.X && Start.Y <= point.Y && End.Y >= point.Y;
예제 #4
0
 public RectangleInt2 Union(RectangleInt2 other) =>
 new RectangleInt2(VectorInt2.Min(Start, other.Start), VectorInt2.Max(End, other.End));
예제 #5
0
 public RectangleInt2 Intersect(RectangleInt2 other) =>
 new RectangleInt2(VectorInt2.Max(Start, other.Start), VectorInt2.Min(End, other.End));
예제 #6
0
 public RectangleInt2(int x0, int y0, int x1, int y1)
 {
     Start = new VectorInt2(x0, y0);
     End   = new VectorInt2(x1, y1);
 }
예제 #7
0
 public RectangleInt2(VectorInt2 start, VectorInt2 end)
 {
     Start = start;
     End   = end;
 }