Skip to content

Commit 7ac8655

Browse files
author
helele
committed
line height bug
if text has lineHeight style, such as English Japanese Chinese cannot be vertically aligned.
1 parent a711fa4 commit 7ac8655

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/Text/Text/RCTTextShadowView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ - (void)postprocessAttributedText:(NSMutableAttributedString *)attributedText
148148
return;
149149
}
150150

151-
CGFloat baseLineOffset = maximumLineHeight / 2.0 - font.lineHeight / 2.0;
151+
CGFloat baseLineOffset = maximumLineHeight / 2.0 - font.pointSize / 2.0;
152152

153153
[attributedText addAttribute:NSBaselineOffsetAttributeName
154154
value:@(baseLineOffset)

0 commit comments

Comments
 (0)