xvrh / lottie-flutter

Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
https://pub.dev/packages/lottie
MIT License
1.13k stars 197 forks source link

Fix rounding-off error on progress calculation #346

Closed yunlinos closed 2 months ago

yunlinos commented 2 months ago

I fix a blinking issue when change lottie progress. The duration of compositon has offset in LottieCompositionParser (parameters.endFrame = reader.nextDouble() - 0.01), but progress calculate is based on the original value(no-offset), the function roundProgress() will caculate a error progress.

The issue is same as: airbnb/lottie-android#1372.

xvrh commented 2 months ago

It would be better with a test but I'll still merge it. Thank you for the contribution.