michaelvillar / dynamics.js

Javascript library to create physics-based animations
http://dynamicsjs.com
7.57k stars 414 forks source link

Inconsistent `dynamics.stop()` #16

Closed stavro closed 8 years ago

stavro commented 8 years ago

Calling dynamics.stop() doesn't work for certain animation types.

Demonstration:

dynamics

http://codepen.io/anon/pen/GpzoYV

stavro commented 8 years ago

I believe this has to do with having a delay added. I would expect stop to stop upcoming animations even if there was a delay set in the animation parameters.

michaelvillar commented 8 years ago

Hey, you're right. This is a bug when multiple delayed animations are pending.

Just fixed it here: https://github.com/michaelvillar/dynamics.js/commit/b2c039763cc5cb6dc44c08623a5ea99414f04b62

stavro commented 8 years ago

Thanks @michaelvillar!