CreateJS / EaselJS

The Easel Javascript library provides a full, hierarchical display list, a core interaction model, and helper classes to make working with the HTML5 Canvas element much easier.
http://createjs.com/
MIT License
8.11k stars 1.97k forks source link

sortChildren on Chrome not working - works in Firefox #1059

Closed danzen closed 3 years ago

danzen commented 3 years ago

image

I put a couple circles in the holder, moved one to the right of the other a little and scaled it a little smaller.

In both the sorts below (tried independently), Firefox (pictured at right) on a PC worked properly and Chrome did nothing - no error... just no change.

holder.sortChildren((one,two)=>{return one.x<two.x}) holder.sortChildren((one,two)=>{return one.scale>two.scale})

In CreateJS the sortChildren just gets turned into a sort on what I assume is an array of children. So... not sure where it is breaking down. I tried a stage update in a timeout in case it was a timing issue but still the same results.

danzen commented 3 years ago

Solved - seems Firefox accepts true and false but chrome does not - it needs 1, -1, 0