Skip to content

Commit 9641db1

Browse files
authored
Revert "[web] Paragraph.longestLine doesn't need to check for isSingleLine anymore (flutter#16736)"
This reverts commit 7758967.
1 parent 8150721 commit 9641db1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ class EngineParagraph implements ui.Paragraph {
210210
return maxWidth;
211211
}
212212

213+
// In the single-line case, the longest line is equal to the maximum
214+
// intrinsic width of the paragraph.
215+
if (_measurementResult.isSingleLine) {
216+
return _measurementResult.maxIntrinsicWidth;
217+
}
218+
213219
// If we don't have any line metrics information, there's no way to know the
214220
// longest line in a multi-line paragraph.
215221
return 0.0;

0 commit comments

Comments
 (0)