-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(text-base): Add Span vertical-align support #8257
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Minor refactoring suggested
I'll try to get back to this when I have time. |
Looking forward to this feature. Thanks @bundyo 👍 |
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Alexander Vakrilov.
|
aa4c5ee
to
05b0355
Compare
Thanks @bundyo for this - I went ahead and refactored based on all suggestions with some minor cleanup and going to get this merged and out 👍 |
} | ||
[lineHeightProperty.setNative](value: number) { | ||
this.nativeTextViewProtected.setLineSpacing(value * layout.getDisplayDensity(), 1); | ||
const fontHeight = this.nativeTextViewProtected.getPaint().getFontMetricsInt(null); | ||
this.nativeTextViewProtected.setLineSpacing(Math.max(value - fontHeight, 0) * layout.getDisplayDensity(), 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bundyo was this intended here and tested as far as you know? We are seeing some oddities on android with line height related to this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, unfortunately the line height in Android wasn't really line height, but instead the space between the two lines, so I changed it to follow what a line height is on web. I communicated then, that this was a breaking change and maybe better left for a major version.
PR Checklist
What is the current behavior?
Currently there's no way to align vertically the Spans in a FormattedString
What is the new behavior?
Spans in FormattedString support the vertical-align CSS property.
Implements #4795.