Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 06957f3

Browse files
Declare a constant for the bit index of the force_strut_height flag value (#24675)
1 parent 09d798c commit 06957f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/ui/text/paragraph_builder.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ const int sFontSizeIndex = 3;
120120
const int sHeightIndex = 4;
121121
const int sLeadingIndex = 5;
122122
const int sForceStrutHeightIndex = 6;
123+
const int sForceStrutHeightValueIndex = 7;
123124

124125
const int sFontWeightMask = 1 << sFontWeightIndex;
125126
const int sFontStyleMask = 1 << sFontStyleIndex;
@@ -128,6 +129,7 @@ const int sFontSizeMask = 1 << sFontSizeIndex;
128129
const int sHeightMask = 1 << sHeightIndex;
129130
const int sLeadingMask = 1 << sLeadingIndex;
130131
const int sForceStrutHeightMask = 1 << sForceStrutHeightIndex;
132+
const int sForceStrutHeightValueMask = 1 << sForceStrutHeightValueIndex;
131133

132134
} // namespace
133135

@@ -215,8 +217,8 @@ void decodeStrut(Dart_Handle strut_data,
215217
paragraph_style.strut_leading = float_data[float_count++];
216218
}
217219
if (mask & sForceStrutHeightMask) {
218-
// The boolean is stored as the last bit in the bitmask.
219-
paragraph_style.force_strut_height = (mask & 1 << 7) != 0;
220+
paragraph_style.force_strut_height =
221+
(mask & sForceStrutHeightValueMask) != 0;
220222
}
221223

222224
if (mask & sFontFamilyMask) {

0 commit comments

Comments
 (0)