Skip to content
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

Parent opacity not working with TextLayer #2317

Closed
westito opened this issue Jun 15, 2023 · 0 comments · Fixed by #2336
Closed

Parent opacity not working with TextLayer #2317

westito opened this issue Jun 15, 2023 · 0 comments · Fixed by #2336

Comments

@westito
Copy link

westito commented Jun 15, 2023

Checklist

  1. My animation doesn't use any unsupported features. ✅
  2. I know what part of my animation doesn't work. ✅
  3. I have created a simplified version of my animation ✅
  4. I have attached the AEP file (as a zip file so it can be attached) that only has the part of the animation that doesn't work. ✅

Describe the bug
Parent opacity not propagated to TextLayer.
The problem is parentAlpha not calculated into TextLayer's alpha: int alpha = opacity * 255 / 100;
Solution: int alpha = (int) ((parentAlpha / 255f * (float) opacity / 100f) * 255); like in BaseLayer (tested & working)
https://github.com/airbnb/lottie-android/blob/master/lottie/src/main/java/com/airbnb/lottie/model/layer/TextLayer.java#L159

What version of Lottie did you test this on?
I found this issue in Dart version of Lottie what is an unofficial conversion of lottie-android. I tested it with the Lottie Android app, where the bug also appeared so I thought it is an "original bug"

What version of Android did you test this on?
Android 31

Steps To Reproduce
Put text into a parent layer and add opacity animation to this parent layer

Screenshots
N/A

Files
opacity_sample.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant