nftchef / art-engine

An advanced fork of the HashLips Art Engine with additional features to generate complex art from provided layers using the familiar Hashlips setup.
MIT License
427 stars 203 forks source link

Fix for zindex sorting not being respected during rebuildAll #250

Closed seibelj closed 1 year ago

seibelj commented 2 years ago

Fix for https://github.com/nftchef/art-engine/issues/236 and https://github.com/nftchef/art-engine/issues/209

Not sure if this is the best place to do it, I'm not an expert in the codebase. But essentially by this point in the code, allImages should be sorted by zindex, but it is not. So this patches the array to sort based on the zindex property of the image objects. This then draws them in order appropriately.

nftchef commented 1 year ago

Thank you for adding this. I will pull this in and modify it to use the same function main.js uses.