ui
ui copied to clipboard
Envelope point sorting not working
trafficstars
this doesn't have any effect, at least in Chrome, leading to some mixed up envelopes when loaded using setPoints.
A workaround to fix this is:
envelope.nodes.sort((a,b)=>{return a.x-b.x})
envelope.render();
I'm not able to duplicate this. Can you post an example of the error you are seeing?
Here is a codepen which adds points out of order and then shows them appearing sorted. We use the same sorting algorithm that you posted.
https://codepen.io/taylorbf/pen/qLZZgp