Infinite recrusion when using addArray of oversized rect with non-exclusive tag matching
tionkje opened this issue · comments
Bastiaan commented
When adding a rect that oversizes the exclusively tagged bin using addArray, It hangs and after some time crashes with RangeError: Maximum call stack size exceeded
const opt = { smart: true, pot: false, square: false, allowRotation: false,
tag: true,
exclusiveTag: false
}
const packer = new MaxRectsPacker(1024, 1024, 0, opt)
let input = [
{width: 2000, height: 1000, data: { tag: 'bla' }}
];
packer.addArray(input); // Never returns / RangeError: Maximum call stack size exceeded
The same happens when the sum of the rects ends up oversized
let input = [
{width: 1000, height: 1000, data: { number:1, tag: 'bla' }},
{width: 1000, height: 1000, data: { number:2, tag: 'bla' }}
];
packer.addArray(input); // Never returns / RangeError: Maximum call stack size exceeded
No big issue, just annoying when trying to reduce the size of the output bins.
Otherwise great stuff 👍
Bastiaan commented
Yes this fixed my test case. Thanks!
I did notice that a single over sized rect seems to just disappear? I think it normally creates a bin with an oversized flag.