From 22cd46f6fc1c471997a67aeaefda83b3d9e8f9b9 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 27 Oct 2023 12:49:49 +0200 Subject: [PATCH] RLottie: Fix animation speed when device limits FPS --- src/lib/rlottie/RLottie.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/rlottie/RLottie.ts b/src/lib/rlottie/RLottie.ts index c230e9592..a1441fd99 100644 --- a/src/lib/rlottie/RLottie.ts +++ b/src/lib/rlottie/RLottie.ts @@ -502,7 +502,7 @@ class RLottie { const now = Date.now(); const currentSpeed = this.lastRenderAt ? this.msPerFrame / (now - this.lastRenderAt) : 1; - const delta = Math.min(1, (this.direction * this.speed) / currentSpeed); + const delta = (this.direction * this.speed) / currentSpeed; const expectedNextFrameIndex = Math.round(this.approxFrameIndex + delta); this.lastRenderAt = now;