Skip to content

Commit

Permalink
line height bug
Browse files Browse the repository at this point in the history
if text has lineHeight style, such as English Japanese Chinese cannot be vertically aligned.
  • Loading branch information
helele committed Jun 8, 2018
1 parent a711fa4 commit 7ac8655
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/Text/Text/RCTTextShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ - (void)postprocessAttributedText:(NSMutableAttributedString *)attributedText
return;
}

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

[attributedText addAttribute:NSBaselineOffsetAttributeName
value:@(baseLineOffset)
Expand Down

0 comments on commit 7ac8655

Please sign in to comment.