mirror of
https://github.com/flutter/flutter
synced 2024-10-04 07:19:46 +00:00
Handle empty text with no line metrics in RenderEditable._lineNumberFor (#93578)
This commit is contained in:
parent
b8df406183
commit
245168f85c
|
@ -2410,7 +2410,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
|
|||
return MapEntry<int, Offset>(lineMetrics.lineNumber, Offset(offset.dx, lineMetrics.baseline));
|
||||
}
|
||||
}
|
||||
assert(false, 'unable to find the line for $startPosition');
|
||||
assert(startPosition.offset == 0, 'unable to find the line for $startPosition');
|
||||
return MapEntry<int, Offset>(
|
||||
math.max(0, metrics.length - 1),
|
||||
Offset(offset.dx, metrics.isNotEmpty ? metrics.last.baseline + metrics.last.descent : 0.0),
|
||||
|
|
Loading…
Reference in a new issue