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.
This commit is contained in:
Reinier Vens 2021-01-11 18:01:03 +00:00
commit eaedf0cee8

View file

@ -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;