@@ -1062,7 +1062,10 @@ void WindowsTextInputComponentView::updateProps(
1062
1062
oldTextInputProps.textAttributes .fontWeight != newTextInputProps.textAttributes .fontWeight ||
1063
1063
!facebook::react::floatEquality (
1064
1064
oldTextInputProps.textAttributes .letterSpacing , newTextInputProps.textAttributes .letterSpacing ) ||
1065
- oldTextInputProps.textAttributes .fontFamily != newTextInputProps.textAttributes .fontFamily ) {
1065
+ oldTextInputProps.textAttributes .fontFamily != newTextInputProps.textAttributes .fontFamily ||
1066
+ !facebook::react::floatEquality (
1067
+ oldTextInputProps.textAttributes .maxFontSizeMultiplier ,
1068
+ newTextInputProps.textAttributes .maxFontSizeMultiplier )) {
1066
1069
m_propBitsMask |= TXTBIT_CHARFORMATCHANGE;
1067
1070
m_propBits |= TXTBIT_CHARFORMATCHANGE;
1068
1071
}
@@ -1422,9 +1425,15 @@ void WindowsTextInputComponentView::UpdateCharFormat() noexcept {
1422
1425
1423
1426
// set font size -- 15 to convert twips to pt
1424
1427
const auto &props = windowsTextInputProps ();
1425
- float fontSize = m_fontSizeMultiplier *
1428
+ float fontSize =
1426
1429
(std::isnan (props.textAttributes .fontSize ) ? facebook::react::TextAttributes::defaultTextAttributes ().fontSize
1427
1430
: props.textAttributes .fontSize );
1431
+
1432
+ // Apply maxFontSizeMultiplier if specified
1433
+ auto maxFontSizeMultiplier = windowsTextInputProps ().textAttributes .maxFontSizeMultiplier ;
1434
+ fontSize *=
1435
+ (maxFontSizeMultiplier >= 1 .0f ) ? std::min (maxFontSizeMultiplier, m_fontSizeMultiplier) : m_fontSizeMultiplier;
1436
+
1428
1437
// TODO get fontSize from props.textAttributes, or defaultTextAttributes, or fragment?
1429
1438
cfNew.dwMask |= CFM_SIZE;
1430
1439
cfNew.yHeight = static_cast <LONG>(fontSize * 15 );
0 commit comments