Respect prop Text.allowFontScaling when sizing text

Summary:
changelog:
[iOS][Fixed] Fix Text.allowFontScaling prop in the new architecture

Reviewed By: javache

Differential Revision: D40643536

fbshipit-source-id: 1fb77b226089ce5e9ffc642b1d9a3de266d202c3
This commit is contained in:
Samuel Susla 2022-10-25 05:51:25 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 5940d25cc1
Коммит e9b89b5ff2
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -71,7 +71,8 @@ inline static UIFont *RCTEffectiveFontFromTextAttributes(const TextAttributes &t
fontProperties.weight = textAttributes.fontWeight.has_value()
? RCTUIFontWeightFromInteger((NSInteger)textAttributes.fontWeight.value())
: NAN;
fontProperties.sizeMultiplier = textAttributes.fontSizeMultiplier;
fontProperties.sizeMultiplier =
textAttributes.allowFontScaling.value_or(true) ? textAttributes.fontSizeMultiplier : 1;
return RCTFontWithFontProperties(fontProperties);
}