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.
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 thezindex
property of the image objects. This then draws them in order appropriately.