diff --git a/src/maxrects-bin.ts b/src/maxrects-bin.ts index 630949e..e732408 100644 --- a/src/maxrects-bin.ts +++ b/src/maxrects-bin.ts @@ -165,7 +165,7 @@ export class MaxRectsBin extends Bin { if (r.width >= height && r.height >= width) { areaFit = r.width * r.height - height * width; if (areaFit < score) { - bestNode = new Rectangle(width, height, r.x, r.y, true); // Rotated node + bestNode = new Rectangle(height, width, r.x, r.y, true); // Rotated node score = areaFit; } }