-
Notifications
You must be signed in to change notification settings - Fork 24.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
Vertically center iOS text if lineHeight is set #7603
Vertically center iOS text if lineHeight is set #7603
Conversation
By analyzing the blame information on this pull request, we identified @nicklockwood and @Kudo to be potential reviewers. |
this is really helpful! please approve this pr |
@tuckerconnelly Can you provide some screenshots from UIExplorer before and after? This might change how existing apps look so it is likely a breaking change though. @nicklockwood, @javache What do you think? |
// vertically center text | ||
CGFloat fontSize = round(_fontSize * (_allowFontScaling && self.fontSizeMultiplier > 0.0 ? self.fontSizeMultiplier : 1.0)); | ||
[attributedString addAttribute:NSBaselineOffsetAttributeName | ||
value:[NSNumber numberWithFloat:lineHeight/2 - fontSize/2] |
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.
Nit: can you replace
[NSNumber numberWithFloat:lineHeight/2 - fontSize/2]
With
@(lineHeight/2 - fontSize/2)
@mkonicek I agree that this should be the default behaviour. Difficult to guess what the impact might be on existing apps though. |
@tuckerconnelly updated the pull request. |
@tuckerconnelly updated the pull request. |
any update? i'm looking forward this pr to be merged |
@facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
33dfc9d
Shame for shipping this without looking at Travis build status https://travis-ci.org/facebook/react-native/jobs/133786669 This PR broke trunk |
After talking to the teams internally, looks like we can't accept this change, have to revert it. |
Feel free to do another iteration and submit a new PR |
That's the nature of a breaking change lol What would you want in another iteration? |
First PR!!
This fixes #2991 :)