File tree 4 files changed +22
-2
lines changed
packages/react-native/ReactCommon/react/renderer
4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ bool ParagraphAttributes::operator==(const ParagraphAttributes& rhs) const {
30
30
rhs.includeFontPadding ,
31
31
rhs.android_hyphenationFrequency ) &&
32
32
floatEquality (minimumFontSize, rhs.minimumFontSize ) &&
33
- floatEquality (maximumFontSize, rhs.maximumFontSize );
33
+ floatEquality (maximumFontSize, rhs.maximumFontSize ) &&
34
+ floatEquality (minimumFontScale, rhs.minimumFontScale );
34
35
}
35
36
36
37
bool ParagraphAttributes::operator !=(const ParagraphAttributes& rhs) const {
Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ class ParagraphAttributes : public DebugStringConvertible {
70
70
Float minimumFontSize{std::numeric_limits<Float>::quiet_NaN ()};
71
71
Float maximumFontSize{std::numeric_limits<Float>::quiet_NaN ()};
72
72
73
+ /*
74
+ * Specifies the smallest possible scale a font can reach when
75
+ * adjustsFontSizeToFit is enabled. (values 0.01-1.0).
76
+ */
77
+ Float minimumFontScale{std::numeric_limits<Float>::quiet_NaN ()};
78
+
73
79
bool operator ==(const ParagraphAttributes&) const ;
74
80
bool operator !=(const ParagraphAttributes&) const ;
75
81
@@ -96,7 +102,8 @@ struct hash<facebook::react::ParagraphAttributes> {
96
102
attributes.minimumFontSize ,
97
103
attributes.maximumFontSize ,
98
104
attributes.includeFontPadding ,
99
- attributes.android_hyphenationFrequency );
105
+ attributes.android_hyphenationFrequency ,
106
+ attributes.minimumFontScale );
100
107
}
101
108
};
102
109
} // namespace std
Original file line number Diff line number Diff line change @@ -948,6 +948,12 @@ inline ParagraphAttributes convertRawProp(
948
948
" adjustsFontSizeToFit" ,
949
949
sourceParagraphAttributes.adjustsFontSizeToFit ,
950
950
defaultParagraphAttributes.adjustsFontSizeToFit );
951
+ paragraphAttributes.minimumFontScale = convertRawProp (
952
+ context,
953
+ rawProps,
954
+ " minimumFontScale" ,
955
+ sourceParagraphAttributes.minimumFontScale ,
956
+ defaultParagraphAttributes.minimumFontScale );
951
957
paragraphAttributes.minimumFontSize = convertRawProp (
952
958
context,
953
959
rawProps,
Original file line number Diff line number Diff line change @@ -96,6 +96,12 @@ void ParagraphProps::setProp(
96
96
paragraphAttributes,
97
97
adjustsFontSizeToFit,
98
98
" adjustsFontSizeToFit" );
99
+ REBUILD_FIELD_SWITCH_CASE (
100
+ paDefaults,
101
+ value,
102
+ paragraphAttributes,
103
+ minimumFontScale,
104
+ " minimumFontScale" );
99
105
REBUILD_FIELD_SWITCH_CASE (
100
106
paDefaults,
101
107
value,
You can’t perform that action at this time.
0 commit comments