-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Keep BaseTextAttributes as part of AttributedString #46612
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
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D63303709 |
|
This pull request was exported from Phabricator. Differential Revision: D63303709 |
Summary: Pull Request resolved: facebook#46612 This information is lost by the time the AttributedString makes its way to be measured. Pretty sure I've seen code do incorrect heuristics like grabbing first span for this (IIRC adjustFontSizeToFit does this)? Another case where we hit this on Android is when the last character is a newline (which is part of the Spannable), and layout needs to predict the size of the line which will come next (where it uses the EditText's underlying TextPaint, who is using these base attributes). Changelog: [Internal] Differential Revision: D63303709
9419315 to
f3fbcab
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63303709 |
Summary: Pull Request resolved: facebook#46612 This information is lost by the time the AttributedString makes its way to be measured. Pretty sure I've seen code do incorrect heuristics like grabbing first span for this (IIRC adjustFontSizeToFit does this)? Another case where we hit this on Android is when the last character is a newline (which is part of the Spannable), and layout needs to predict the size of the line which will come next (where it uses the EditText's underlying TextPaint, who is using these base attributes). Changelog: [Internal] Differential Revision: D63303709
f3fbcab to
77f432d
Compare
Summary: This information is lost by the time the AttributedString makes its way to be measured. Pretty sure I've seen code do incorrect heuristics like grabbing first span for this (IIRC adjustFontSizeToFit does this)? Another case where we hit this on Android is when the last character is a newline (which is part of the Spannable), and layout needs to predict the size of the line which will come next (where it uses the EditText's underlying TextPaint, who is using these base attributes). Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D63303709
77f432d to
f41d855
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63303709 |
|
This pull request has been merged in a11a7c3. |
|
This pull request was successfully merged by @NickGerleman in a11a7c3 When will my fix make it into a release? | How to file a pick request? |
Summary:
This information is lost by the time the AttributedString makes its way to be measured.
Pretty sure I've seen code do incorrect heuristics like grabbing first span for this (IIRC adjustFontSizeToFit does this)? Another case where we hit this on Android is when the last character is a newline (which is part of the Spannable), and layout needs to predict the size of the line which will come next (where it uses the EditText's underlying TextPaint, who is using these base attributes).
Changelog: [Internal]
Differential Revision: D63303709