Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

Fix timeline progress

Julian Garnier6481c68f92a1
diff --git a/anime.js b/anime.js
index b2683667..a74c68ee 100644
--- a/anime.js
+++ b/anime.js
@@ -643,8 +643,6 @@
instance.animatables[id].target.style[transformString] = transforms[id].join(' ');
}
}
- if (instance.update) instance.update(instance);
- if (instance.children) syncInstanceChildren(instance, currentTime);
}
function setInstanceProgress(instance, tickTime) {
@@ -664,6 +662,8 @@
instance.ended = true;
progression(instance, instanceDuration);
}
+ if (instance.update) instance.update(instance);
+ if (instance.children) syncInstanceChildren(instance, currentTime);
}
function getInstanceTimings(type, animations, tweenSettings) {
@@ -719,8 +719,7 @@
instance.tick = function(now) {
if (!startTime) startTime = now;
- const currentTime = (lastTime + now - startTime) * anime.speed;
- const tickTime = minMaxValue(currentTime, 0, instance.duration);
+ const tickTime = (lastTime + now - startTime) * anime.speed;
setInstanceProgress(instance, tickTime);
if (!instance.began && tickTime >= instance.delay) {
instance.began = true;