-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Incorrect positioning of custom text #1758
Comments
I'm having the exact same issue. Haven't been able to find a solution. I've tried messing around with After Effects and whatever I do the text is never rendered in Android in the same position that it looks in AE. |
I have facing same issue In iOS text position showing currently but in android showing wrong position text. Only issue on text position. |
Same issue for me, If I try to use the TextDelegate, the Text moved to a wrong position. Without the TextDelegate it works, but than we can't translate the labels. |
Same! |
Still no fix? |
Having the same issue :( |
Same here :( |
@vincekao-dd @oissa1 @AjayGol @tkrawetzke @LorienMan @okamayana-tinyspeck @cjmFirefly03 @frankiesimon Could you all please attach aep files that reproduce this? Including them will always increase the likelihood that bugs can get addressed. |
I am also getting the same problem. Not my animation, but using this animation: And applying the filter via:
I am getting the following: Which is wrong, as the text "my custom string 123" should be left aligned, along with the cursor, but it is shifted to the right. Version: com.airbnb.android:lottie:5.0.3 (Small note, I did try with this file first, but it rendered fine: https://lottiefiles.com/58264-pin-on-the-map). I'm not an animation expert though, so not sure if there is a connection.... |
This PR completely rewrites the text layout algorithm. It should be more accurate in most cases now. Center and right justifications as well as alignment of paragraph text and text wrapping should all be much more accurate. Note that there may be an outstanding issue with the y position of paragraph text which affects #1758 but I have been unable to reproduce it with an AEP file for debugging. Fixes #1479 Fixes #1758 Fixes #397 Likely fixes #2135
Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.
Checklist
Describe the bug
Our animation consists of an envelope that opens up to display a card with custom user-defined text. We set the text using a TextDelegate and a custom font. The entire animation works perfectly and the correct text/font is displayed, but the positioning of the text is misaligned. Rather than being aligned with the left side of the card, the text area seems to start in the middle. It's still left-justified, but the XY coordinates of the textbox are shifted to the center coordinates of the card.
We experimented with a modified version of the animation where we aligned the center X of the textbox with the left edge of the canvas (so that the left half of the text box is outside the card) and this seemed to fix the issue. The problem is that we have a constantly increasing number of variations of this animation which all work as expected in their original form on both iOS and Web, so producing a separate version of each animation for Android is not a viable solution.
This seems to be the same issue as described in these reports, but there is no recent activity or posted solution:
#388
#481
#451
Thanks in advance for your assistance!
What version of Lottie did you test this on?
3.6.1
What version of Android did you test this on?
APIs 27-30
Steps To Reproduce
Steps to reproduce the behavior:
Screenshots
![image](https://user-images.githubusercontent.com/77299384/110676475-dab89f80-8188-11eb-9f74-38d652aa2fcc.png)
![image](https://user-images.githubusercontent.com/77299384/110676563-f2902380-8188-11eb-80f0-85b1e5a99380.png)
json attached:
misaligned_text.json.zip
The text was updated successfully, but these errors were encountered: