From eaedf0cee80f7f3aabd469e28fc9d4478d421bc3 Mon Sep 17 00:00:00 2001 From: Reinier Vens Date: Mon, 11 Jan 2021 18:01:03 +0000 Subject: [PATCH] Update ItemData.cs Fixed EDGE case where Shape.Inset would cut off columns of the inset shape when inset position was close the rightmost EDGE of parent shape. --- Assets/Scripts/ServerShared/ItemData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/ServerShared/ItemData.cs b/Assets/Scripts/ServerShared/ItemData.cs index 978996f15..7aeea963d 100644 --- a/Assets/Scripts/ServerShared/ItemData.cs +++ b/Assets/Scripts/ServerShared/ItemData.cs @@ -154,7 +154,7 @@ public class Shape public Shape Inset(Shape inset, int2 insetPosition, ItemRotation rotation = ItemRotation.None) { - var shape = new Shape(Width, Height); + var shape = new Shape(max(Width,insetPosition.x + inset.Width - 1), max(Height, insetPosition.y + inset.Height - 1)); foreach (var v in inset.Coordinates) { var insetCoord = inset.Rotate(v, rotation) + insetPosition;