解决gif图片只有1帧时因帧时间延时时间为NaN时导致图片帧不显示的问题

Signed-off-by: 李艺为 <liyiwei18@h-partners.com>
This commit is contained in:
李艺为 2023-08-11 17:32:08 +08:00
parent f109b3b061
commit 0ecd3db6ac
1 changed files with 3 additions and 0 deletions

View File

@ -622,6 +622,9 @@ export struct ImageKnifeComponent {
}
// 减去程序执行消耗,剩余的准确延迟时间
let delayTime = Math.max(0, Math.floor(stayTime - diff));
if (!delayTime) {
delayTime = 100;
}
this.endGifLoopTime = end;
// 当前gif到第N帧,所对应的N渲染时间和N-1的停留时间。第一帧只有渲染时间没有停留时间