Tencent / vap

VAP是企鹅电竞开发,用于播放特效动画的实现方案。具有高压缩率、硬件解码等优点。同时支持 iOS,Android,Web 平台。
Other
3.89k stars 523 forks source link

iOS当播放次数为1时动画会播放2次: [UIView (VAP) hwd_didFinishDisplay]中的判断 if (currentCount == -1 || currentCount-- > 0) 可能有问题 #325

Closed yto1 closed 1 year ago

yto1 commented 1 year ago

[UIView (VAP) hwd_didFinishDisplay]中的判断条件 if (currentCount == -1 || currentCount-- > 0){} 。currentCount-- > 0,相当于先currentCount > 0, 再currentCount--。当currentCount=1时,currentCount-- > 0是YES,所以会执行判断条件中的代码再次播放。

wubiner commented 1 year ago

这里函数参数命名是repeat,所以设置1的话,说明是要重复1次,也就是2次播放。