Add NAN check for text font sizeMultiplier (#24966)
Summary: Set `sizeMultiplier` to `1.0` if default value is `NAN`, otherwise, text cannot show properly. ## Changelog [iOS] [Fixed] - Add NAN check for text font sizeMultiplier Pull Request resolved: https://github.com/facebook/react-native/pull/24966 Differential Revision: D15466559 Pulled By: shergin fbshipit-source-id: 6f8b47eb8e521cb120d7f351cba02dbf1c5411fd
This commit is contained in:
Родитель
b355ba56db
Коммит
3616941ef8
|
@ -154,6 +154,7 @@ TextAttributes TextAttributes::defaultTextAttributes() {
|
|||
textAttributes.foregroundColor = blackColor();
|
||||
textAttributes.backgroundColor = clearColor();
|
||||
textAttributes.fontSize = 14.0;
|
||||
textAttributes.fontSizeMultiplier = 1.0;
|
||||
return textAttributes;
|
||||
}();
|
||||
return textAttributes;
|
||||
|
|
|
@ -137,6 +137,7 @@ UIFont *RCTFontWithFontProperties(RCTFontProperties fontProperties) {
|
|||
RCTFontProperties defaultFontProperties = RCTDefaultFontProperties();
|
||||
fontProperties = RCTResolveFontProperties(fontProperties);
|
||||
|
||||
assert(!isnan(fontProperties.sizeMultiplier));
|
||||
CGFloat effectiveFontSize =
|
||||
fontProperties.sizeMultiplier * fontProperties.size;
|
||||
UIFont *font;
|
||||
|
|
Загрузка…
Ссылка в новой задаче