diff --git a/project/code/TMV/RectPacker.cs b/project/code/TMV/RectPacker.cs index 250a5c2..2762914 100644 --- a/project/code/TMV/RectPacker.cs +++ b/project/code/TMV/RectPacker.cs @@ -13,7 +13,7 @@ public static class RectPacker public ushort Height; } - public static Rect Pack(Rect[] rectangles, ushort width = 1024, ushort minHeight = 512) + public static Rect Pack(Rect[] rectangles, ushort width = 2048, ushort minHeight = 512) { ArgumentNullException.ThrowIfNull(rectangles); ArgumentOutOfRangeException.ThrowIfZero(width); @@ -40,15 +40,11 @@ public static class RectPacker for (var i = 0; i < rectCount; i++) { var rect = rectangles[i]; - if (x + rect.Width > bounds.Width) + if (x + rect.Width > width) { x = 0; y += rowMaxH; rowMaxH = rect.Height; - if (y + rowMaxH > bounds.Height) - { - bounds.Height *= 2; - } } rect.X = x;