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

Allow easing to go negative for bounce in/out #330

Closed idlewan closed 6 months ago

idlewan commented 6 months ago

Don't clamp interpolated distance along path to 'progress' value between 0 and 1.

Bounce in / Bounce out easings can transform the progress to negative values or values higher than 1. getTangentForOffset unfortunately clamps the input to be between 0 and 1, so we need to handle the t < 0 and t > 1 cases separately.

This is an existing problem with flutter-android as well, I'll submit a patch for it. There also seem to be a rendering problem in lottie-web for bounce easings along curve paths unfortunately. The lottie file on iOS with lottie-ios renders as expected, if you need to check with a working renderer.

xvrh commented 6 months ago

Thanks for the contribution