From 8153a8a5ef496393f75234c1f64abfede954917b Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 26 Feb 2021 17:17:21 -0800 Subject: [PATCH] Declare a constant for the bit index of the force_strut_height flag value --- lib/ui/text/paragraph_builder.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index 79dbe23b9957a..dd5f17fb6a751 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -120,6 +120,7 @@ const int sFontSizeIndex = 3; const int sHeightIndex = 4; const int sLeadingIndex = 5; const int sForceStrutHeightIndex = 6; +const int sForceStrutHeightValueIndex = 7; const int sFontWeightMask = 1 << sFontWeightIndex; const int sFontStyleMask = 1 << sFontStyleIndex; @@ -128,6 +129,7 @@ const int sFontSizeMask = 1 << sFontSizeIndex; const int sHeightMask = 1 << sHeightIndex; const int sLeadingMask = 1 << sLeadingIndex; const int sForceStrutHeightMask = 1 << sForceStrutHeightIndex; +const int sForceStrutHeightValueMask = 1 << sForceStrutHeightValueIndex; } // namespace @@ -215,8 +217,8 @@ void decodeStrut(Dart_Handle strut_data, paragraph_style.strut_leading = float_data[float_count++]; } if (mask & sForceStrutHeightMask) { - // The boolean is stored as the last bit in the bitmask. - paragraph_style.force_strut_height = (mask & 1 << 7) != 0; + paragraph_style.force_strut_height = + (mask & sForceStrutHeightValueMask) != 0; } if (mask & sFontFamilyMask) {