-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tvg_set_frame fails on lastframe #2147
Comments
It looks like a floating-point precision problem. |
@theashraf Hello, this is a good topic to discussion. Currently, tvg ignores the frame value if the difference is less than 0.001. How could people notice changes within 1ms? In most cases, in my opinion, updating the frames when the change is less than 1ms is just an unnecessary burden on the system. In your case, the difference is approximately 0.00023, tvg returns the false to skip the frame update by user as it's intended to use like this:
Thus, I suggest a more practical test:
or
Please feel free to leave your opinion if you have different thought. Thanks. |
Currently, tvg ignores the frame value if the difference is less than 0.001. In most cases, updating the frames when the change is less than 1ms is just an unnecessary burden on the system. Instead, this ensures that the perfect last frame is reached. issue: #2147
Currently, tvg ignores the frame value if the difference is less than 0.001. In most cases, updating the frames when the change is less than 1ms is just an unnecessary burden on the system. Instead, this ensures that the perfect last frame is reached. issue: #2147
Thank you, @hermet. That makes sense |
Currently, tvg ignores the frame value if the difference is less than 0.001. In most cases, updating the frames when the change is less than 1ms is just an unnecessary burden on the system. Instead, this ensures that the perfect last frame is reached. issue: #2147
Currently, tvg ignores the frame value if the difference is less than 0.001. In most cases, updating the frames when the change is less than 1ms is just an unnecessary burden on the system. Instead, this ensures that the perfect last frame is reached. issue: #2147
in dotLottie-rs, I'm facing an issue with a lottie animation consists of 42 total frames, and when
tvg_set_frame
is called in the animation loop with last_frame set to 41, it sometimes returnsTVG_RESULT_INSUFFICIENT_CONDITION
. This error prevents the animation from reaching its completion condition. Interestingly, this issue only occurs if the penultimate frame (pre_last_frame) is interpolated to a value very close to the last frame (for example, 40.99977). When frame interpolation is disabled, this issue does not occur.Here is the asset link for reference: R3nSQxmVaC.json
Below is the Rust test code snippet illustrating the problem:
Any insights into why this might be happening?
The text was updated successfully, but these errors were encountered: