Skip to content

Commit

Permalink
fix: Non-exclusive tag logic: Restart test iteration on next tag group
Browse files Browse the repository at this point in the history
As mentioned by Cosmo on issue #20

via #20
  • Loading branch information
soimy committed Sep 17, 2020
1 parent 663f7b2 commit 8b59925
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/maxrects-packer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ export class MaxRectsPacker<T extends IRectangle = Rectangle> {
// do addArray()
this.sort(rects.slice(currentIdx, i), this.options.logic).forEach(r => bin.add(r));
currentIdx = i;
testBin = bin.clone();

// recrusively addArray() with remaining rects
this.addArray(rects.slice(i));
return true;
}

// remaining untagged rect will use normal addArray()
Expand Down

0 comments on commit 8b59925

Please sign in to comment.