Unverified Commit 245168f8 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Handle empty text with no line metrics in RenderEditable._lineNumberFor (#93578)

parent b8df4061
......@@ -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),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment