This implements the MAXRECTS algorithm (using the best short side fit heuristic), as detailed in the paper A thousand ways to pack the bin by Jukka Jylänki. Since this code was ported pretty much directly from the CPP version, there's probably still improvements that can be made here and there, both in readability and safety.
To facilitate more complicated algorithms, the interface has been changed to allow returning multiple sprite sheets instead of just one, and adding options for a packer. The simple packer will behave exactly the same, and will output an arbitrarily big spritesheet as the first element.
What's still missing:
[x] Some tests to make sure this always behaves as we want it to
This implements the MAXRECTS algorithm (using the best short side fit heuristic), as detailed in the paper A thousand ways to pack the bin by Jukka Jylänki. Since this code was ported pretty much directly from the CPP version, there's probably still improvements that can be made here and there, both in readability and safety.
To facilitate more complicated algorithms, the interface has been changed to allow returning multiple sprite sheets instead of just one, and adding options for a packer. The simple packer will behave exactly the same, and will output an arbitrarily big spritesheet as the first element.
What's still missing: