antvis / G

💥 A flexible rendering engine for visualization.
https://g.antv.antgroup.com/
1.04k stars 192 forks source link

fix: fix sometime onfinish not invoke #1715

Closed Aarebecca closed 1 week ago

Aarebecca commented 1 week ago

🤔 This is a ...

🔗 Related issue link

💡 Background and solution

camera.gotoLandmark 有一定概率不会执行 onfinish 回调函数

问题原因: requestAnimationFrame 计时误差导致小概率情况下 elapsed === duration 从而不会执行下一帧而无法执行 endAnimation 方法


camera.gotoLandmark will not execute the onfinish callback with some probability

Cause: a timing error in 'requestAnimationFrame' causes a small probability of 'elapsed === duration' which prevents' endAnimation 'from executing the next frame

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge