tfmart / LottieUI

LottieUI is a SwiftUI wrapper for Lottie Animations for iOS
MIT License
92 stars 2 forks source link

Scale animation to fit parent container #3

Closed Psli closed 2 years ago

Psli commented 2 years ago
HStack {
  LottieView("loading").loopMode(.loop)
}.frame(width: 200, height: 200, alignment: .center)

See here for solution? https://github.com/airbnb/lottie-ios/issues/1050

tfmart commented 2 years ago

Hi @Psli, thanks for reporting this issue. Could you link me the animation you're trying to use so I can try to reproduce it? I haven't run into this on my project at least.

In the meantime, if you end up making some changes to the library that fixes this issue, feel free to let me know!

Psli commented 2 years ago

This is a test project https://github.com/Psli/TestLottieUI.git LottieView(...).frame(width: 200, height: 200, alignment: .center) not working

tfmart commented 2 years ago

Thanks for the demo, I'll give a looks and see if I can sort it out

tfmart commented 2 years ago

Hey @Psli, I've submitted a PR that may fix your issue. Could you try using the mac-scaling-fix branch on your project and check if the issue persists?

Psli commented 2 years ago

Hey @tfmart , the PR fix my issue. Thanks!

tfmart commented 2 years ago

Great! I've merged the branch and released a new version 1.3.1 which contains this patch, so I'll be closing this issue. If you run into any other problem, feel free to reach out!