juliangarnier / anime

JavaScript animation engine
https://animejs.com
MIT License
50.45k stars 3.69k forks source link

add limit to `getDuration()` in `spring` function to avoid infinite loops #798

Open okikio opened 2 years ago

okikio commented 2 years ago

The way the getDuration() method in the spring() function is setup it doesn't have any way of stopping an infinite loop. I added a INTINITE_LOOP_LIMIT of 10,000 to stop possible infinite loop situations.

okikio commented 2 years ago

After re-looking though the problem I've determined that the issue I had doesn't require an infinite loop limit, I still believe we should apply a loop limit to the getDuration() method, but it's not required for my problem.

If you'd like to see the problem I aiming to fix, here is a Codepen, https://codepen.io/okikio/pen/GRMeapZ?editors=0010

cc @RafaelKr