优化动画帧播放间隔计算,移除最低间隔限制
使用序列总时长除以帧数计算真实播放间隔。 删除四十毫秒下限,保持高帧率动画的实际节奏。
This commit is contained in:
@@ -832,7 +832,7 @@ function ImageCanvasImageSequenceLayer({
|
||||
layer.imageSequenceDurationMs > 0
|
||||
? layer.imageSequenceDurationMs
|
||||
: (frames.length / 8) * 1_000;
|
||||
const intervalMs = Math.max(40, Math.round(durationMs / frames.length));
|
||||
const intervalMs = durationMs / frames.length;
|
||||
const timer = window.setInterval(() => {
|
||||
setFrameIndex((currentIndex) => (currentIndex + 1) % frames.length);
|
||||
}, intervalMs);
|
||||
|
||||
Reference in New Issue
Block a user