Update src/runtime/motion/spring.ts

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
pull/7011/head
Rich Harris 3 years ago committed by GitHub
parent bc4efb013e
commit 8ccfa7f532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -115,7 +115,7 @@ export function spring<T=any>(value?: T, opts: SpringOpts = {}): Spring<T> {
inv_mass = Math.min(inv_mass + inv_mass_recovery_rate, 1);
last_time = Math.max(last_time, now - tick * limit);
while ( last_time < now ) {
while (last_time < now) {
const elapsed = Math.min(tick, now - last_time);
last_time += elapsed;

Loading…
Cancel
Save