tinyjin / lottie-thorvg

Fast and compact Lottie for Flutter using ThorVG as a renderer. (beta)
https://pub.dev/packages/lottie_thorvg
MIT License
7 stars 0 forks source link

Support BoxFit #3

Open tinyjin opened 3 months ago

tinyjin commented 3 months ago

When the canvas size is bigger than animation has, image is resized like Boxfit.fill. This issue causes different size from lottie-flutter.

Step 1. Must ensure the default rendering result is Boxfit.none. Screenshot 2024-03-14 at 9 58 45 PM

Step 2. Should support 7 options on BoxFit enum: https://api.flutter.dev/flutter/painting/BoxFit.html

The parameter usage will be:

Lottie.asset(
    'assets/path/to/lottie.json',
    width: 300,
    height: 300,
    fit: BoxFit.cover
)

Artboard 1