svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.04k stars 1.08k forks source link

ease() method not working with during() #1156

Closed lucafaggianelli closed 3 years ago

lucafaggianelli commented 3 years ago

Bug report

I need to animate an object along a path, as explained here: https://svgjs.com/docs/3.0/tutorials/ (which by the way is using SVG.js v2 and it doesn't work with v3). I was able to migrate the demo to v3, but the easing function doesn't work. it defaults to linear, whereas I try to use easeInOut

Fiddle

this codepen is now updated with the solution

https://codepen.io/lucafaggianelli/pen/abZoBxB

Explanation

Fuzzyma commented 3 years ago

The position which is passed to the during function is not the eased position. This is by design because if allows for more freedom. If you need the eased position just run it through the easing function (SVG.easing['<>'](pos))

lucafaggianelli commented 3 years ago

cool! thanks, I updated the codepen and it's now working