Skip to content

Commit 86682a2

Browse files
authored
Web PargraphStyle TextHeightBehavior integration (flutter#16075)
1 parent 26fd7d0 commit 86682a2

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

lib/ui/text.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ class ParagraphStyle {
10311031
'maxLines: ${ _encoded[0] & 0x020 == 0x020 ? _encoded[5] : "unspecified"}, '
10321032
'textHeightBehavior: ${
10331033
_encoded[0] & 0x040 == 0x040 ?
1034-
TextHeightBehavior.fromEncoded(_encoded[6]).toString() : "unspecified"}, '
1034+
TextHeightBehavior.fromEncoded(_encoded[6]).toString() : "unspecified"}, '
10351035
'fontFamily: ${ _encoded[0] & 0x080 == 0x080 ? _fontFamily : "unspecified"}, '
10361036
'fontSize: ${ _encoded[0] & 0x100 == 0x100 ? _fontSize : "unspecified"}, '
10371037
'height: ${ _encoded[0] & 0x200 == 0x200 ? "${_height}x" : "unspecified"}, '

lib/web_ui/lib/src/engine/text/paragraph.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,21 @@ class EngineParagraphStyle implements ui.ParagraphStyle {
545545
}
546546

547547
@override
548-
int get hashCode =>
549-
ui.hashValues(_fontFamily, _fontSize, _height, _ellipsis, _locale);
548+
int get hashCode {
549+
return ui.hashValues(
550+
_textAlign,
551+
_textDirection,
552+
_fontWeight,
553+
_fontStyle,
554+
_maxLines,
555+
_fontFamily,
556+
_fontSize,
557+
_height,
558+
_textHeightBehavior,
559+
_ellipsis,
560+
_locale
561+
);
562+
}
550563

551564
@override
552565
String toString() {
@@ -557,6 +570,7 @@ class EngineParagraphStyle implements ui.ParagraphStyle {
557570
'fontWeight: ${_fontWeight ?? "unspecified"}, '
558571
'fontStyle: ${_fontStyle ?? "unspecified"}, '
559572
'maxLines: ${_maxLines ?? "unspecified"}, '
573+
'textHeightBehavior: ${_textHeightBehavior ?? "unspecified"}, '
560574
'fontFamily: ${_fontFamily ?? "unspecified"}, '
561575
'fontSize: ${_fontSize != null ? _fontSize.toStringAsFixed(1) : "unspecified"}, '
562576
'height: ${_height != null ? "${_height.toStringAsFixed(1)}x" : "unspecified"}, '

0 commit comments

Comments
 (0)