|
@@ -55,7 +55,8 @@ public struct ShapeCorners
|
|
{
|
|
{
|
|
get
|
|
get
|
|
{
|
|
{
|
|
- Span<VecD> lengths = stackalloc[] {
|
|
|
|
|
|
+ Span<VecD> lengths = stackalloc[]
|
|
|
|
+ {
|
|
TopLeft - TopRight,
|
|
TopLeft - TopRight,
|
|
TopRight - BottomRight,
|
|
TopRight - BottomRight,
|
|
BottomRight - BottomLeft,
|
|
BottomRight - BottomLeft,
|
|
@@ -133,7 +134,7 @@ public struct ShapeCorners
|
|
TopLeft = TopLeft.ReflectY(horAxisY),
|
|
TopLeft = TopLeft.ReflectY(horAxisY),
|
|
TopRight = TopRight.ReflectY(horAxisY)
|
|
TopRight = TopRight.ReflectY(horAxisY)
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
public ShapeCorners AsMirroredAcrossVerAxis(int verAxisX) => new ShapeCorners
|
|
public ShapeCorners AsMirroredAcrossVerAxis(int verAxisX) => new ShapeCorners
|
|
{
|
|
{
|
|
BottomLeft = BottomLeft.ReflectX(verAxisX),
|
|
BottomLeft = BottomLeft.ReflectX(verAxisX),
|
|
@@ -150,6 +151,14 @@ public struct ShapeCorners
|
|
TopRight = TopRight.Rotate(angle, around)
|
|
TopRight = TopRight.Rotate(angle, around)
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ public ShapeCorners AsTranslated(VecD delta) => new ShapeCorners
|
|
|
|
+ {
|
|
|
|
+ BottomLeft = BottomLeft + delta,
|
|
|
|
+ BottomRight = BottomRight + delta,
|
|
|
|
+ TopLeft = TopLeft + delta,
|
|
|
|
+ TopRight = TopRight + delta
|
|
|
|
+ };
|
|
|
|
+
|
|
public static bool operator !=(ShapeCorners left, ShapeCorners right) => !(left == right);
|
|
public static bool operator !=(ShapeCorners left, ShapeCorners right) => !(left == right);
|
|
public static bool operator == (ShapeCorners left, ShapeCorners right)
|
|
public static bool operator == (ShapeCorners left, ShapeCorners right)
|
|
{
|
|
{
|