I tried building an interaction where toValue is determined by the user's pointer. The spring doesn't start animating until the gesture rests, because _reset() is called inside updateConfig(), which keeps t locked at 0.
I'll have to keep thinking about this to find the best solution. Some options:
Add a flag to updateConfig that suppresses _reset and/or only call reset() when certain parameters change.
Have _reset() set t=16ms, so the spring always makes progress towards its destination.
Call _step(performance.now()) inside updateConfig() to update the initial values before _reset() happens.
I tried building an interaction where
toValue
is determined by the user's pointer. The spring doesn't start animating until the gesture rests, because_reset()
is called insideupdateConfig()
, which keepst
locked at0
.I'll have to keep thinking about this to find the best solution. Some options:
updateConfig
that suppresses_reset
and/or only callreset()
when certain parameters change._reset()
sett=16ms
, so the spring always makes progress towards its destination._step(performance.now())
insideupdateConfig()
to update the initial values before_reset()
happens.