@@ -213,15 +213,20 @@ class TextHeightBehavior {
213213 const TextHeightBehavior ({
214214 this .applyHeightToFirstAscent = true ,
215215 this .applyHeightToLastDescent = true ,
216+ this .leadingDistribution = LeadingDistribution .proportional,
216217 });
217- const TextHeightBehavior .fromEncoded (int encoded)
218- : applyHeightToFirstAscent = (encoded & 0x1 ) == 0 ,
219- applyHeightToLastDescent = (encoded & 0x2 ) == 0 ;
218+ TextHeightBehavior .fromEncoded (int encoded)
219+ : applyHeightToFirstAscent = (encoded & 0x1 ) == 0 ,
220+ applyHeightToLastDescent = (encoded & 0x2 ) == 0 ,
221+ leadingDistribution = LeadingDistribution .values[encoded >> 2 ];
220222 final bool applyHeightToFirstAscent;
221223 final bool applyHeightToLastDescent;
224+ final LeadingDistribution leadingDistribution;
222225
223226 int encode () {
224- return (applyHeightToFirstAscent ? 0 : 1 << 0 ) | (applyHeightToLastDescent ? 0 : 1 << 1 );
227+ return (applyHeightToFirstAscent ? 0 : 1 << 0 )
228+ | (applyHeightToLastDescent ? 0 : 1 << 1 )
229+ | (leadingDistribution.index << 2 );
225230 }
226231
227232 @override
@@ -230,7 +235,8 @@ class TextHeightBehavior {
230235 return false ;
231236 return other is TextHeightBehavior
232237 && other.applyHeightToFirstAscent == applyHeightToFirstAscent
233- && other.applyHeightToLastDescent == applyHeightToLastDescent;
238+ && other.applyHeightToLastDescent == applyHeightToLastDescent
239+ && other.leadingDistribution == leadingDistribution;
234240 }
235241
236242 @override
@@ -245,7 +251,8 @@ class TextHeightBehavior {
245251 String toString () {
246252 return 'TextHeightBehavior('
247253 'applyHeightToFirstAscent: $applyHeightToFirstAscent , '
248- 'applyHeightToLastDescent: $applyHeightToLastDescent '
254+ 'applyHeightToLastDescent: $applyHeightToLastDescent , '
255+ 'leadingDistribution: $leadingDistribution '
249256 ')' ;
250257 }
251258}
0 commit comments