fix: ensure that CSS is generated for the final frame of a transition

pull/11251/head
Rich Harris 2 years ago
parent a764f4e88e
commit 10ee7b3272

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ensure that CSS is generated for the final frame of a transition

@ -322,7 +322,7 @@ function animate(element, options, counterpart, t2, callback) {
if (css) { if (css) {
// WAAPI // WAAPI
var keyframes = []; var keyframes = [];
var n = duration / (1000 / 60); var n = Math.ceil(duration / (1000 / 60)); // `n` must be an integer, or we risk missing the `t2` value
for (var i = 0; i <= n; i += 1) { for (var i = 0; i <= n; i += 1) {
var t = t1 + delta * easing(i / n); var t = t1 + delta * easing(i / n);

Loading…
Cancel
Save