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

fixed: Using Text Delegate and scaletype then the textfield wont posi… #1583

Closed

Conversation

pikaMouse
Copy link

I had the same issue as #1310. When I use TextDelegate to change the text in my animation and I use a scaletype for example "Center" then the textfield doesn't respect the scaling & positioning of the LottieAnimationView.At present,I've fixed it with using "concat" rather than "setMatrix" before draw something in the canvas. The difference between them as follow:

  • setMatrix:Completely replace the current matrix with the specified matrix.
  • concat:Preconcat the current matrix with the specified matrix

@mgod
Copy link
Contributor

mgod commented Sep 29, 2020

This fixed some text layout issues I was having as well. If we get this or a similar PR passing on the master branch, is it likely to get merged?

@pikaMouse pikaMouse changed the base branch from gpeal/support to master September 29, 2020 05:05
@pikaMouse
Copy link
Author

This fixed some text layout issues I was having as well. If we get this or a similar PR passing on the master branch, is it likely to get merged?

I try it

@pikaMouse pikaMouse changed the base branch from master to gpeal/support September 29, 2020 05:14
@pikaMouse pikaMouse changed the base branch from gpeal/support to master September 29, 2020 05:14
pikaMouse and others added 2 commits September 29, 2020 13:46
merge code form fork master
# Conflicts:
#	LottieSample/src/main/kotlin/com/airbnb/lottie/samples/PreviewItemView.kt
#	LottieSample/src/main/kotlin/com/airbnb/lottie/samples/TestColorFilterActivity.java
#	LottieSample/src/main/kotlin/com/airbnb/lottie/samples/views/ControlBarItemToggleView.kt
@pikaMouse pikaMouse changed the base branch from master to gpeal/support September 29, 2020 06:03
@pikaMouse pikaMouse changed the base branch from gpeal/support to master September 29, 2020 06:04
@pikaMouse pikaMouse closed this Sep 29, 2020
@mgod
Copy link
Contributor

mgod commented Sep 30, 2020

@pikaMouse I hope you don't mind, I included this commit along with some other dynamic text layout fixes in PR #1635

@pikaMouse
Copy link
Author

@pikaMouse I hope you don't mind, I included this commit along with some other dynamic text layout fixes in PR #1635

Of course not

gpeal pushed a commit that referenced this pull request Oct 2, 2020
Close #1183. Close #1310.

This has a couple of related bugfixes.

Fix the scale/positioning of the text relative to the parent (from PR #1583, thanks @pikaMouse)
Include text tracking values in the line width used for text alignment
Scale the text tracking values based on the font size rather than the parent size (parent size adjustment is already handled when we're calculating tracking values)
Include all bytes for multibyte characters when calculating canvas offsets for characters.
gpeal pushed a commit that referenced this pull request Oct 4, 2020
Close #1183. Close #1310.

This has a couple of related bugfixes.

Fix the scale/positioning of the text relative to the parent (from PR #1583, thanks @pikaMouse)
Include text tracking values in the line width used for text alignment
Scale the text tracking values based on the font size rather than the parent size (parent size adjustment is already handled when we're calculating tracking values)
Include all bytes for multibyte characters when calculating canvas offsets for characters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants