Closed basil-cow closed 5 years ago
Nope, that's definitely just an easy optimization that can be done. I wrote that code once and never looked at it again, must've just missed that =P Would be happy about a PR here!
this can now be closed with #22 merging
Will close when #22 is through.
When finding an anchor corresponding to a sprite in pack(), program iterates over all anchors for each sprite. I assume that it's for maintaining sprite order (but they could be still in different sheets, right? so why does it matter if they are sorted?). O(n^2) can be reduced to O(n) with a hashmap of anchors, but maybe I'm missing some context why it was done the way it is.