RLottie: Fix animation speed when device limits FPS

This commit is contained in:
Alexander Zinchuk 2023-10-27 12:49:49 +02:00
parent e898aa01a7
commit 22cd46f6fc

View File

@ -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;