Commit d77955fb authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Pass the width constraint to the text layout engine if ellipsizing is enabled (#11877)

parent c5750cd7
......@@ -148,7 +148,10 @@ class RenderParagraph extends RenderBox {
}
void _layoutText({ double minWidth: 0.0, double maxWidth: double.INFINITY }) {
_textPainter.layout(minWidth: minWidth, maxWidth: _softWrap ? maxWidth : double.INFINITY);
_textPainter.layout(
minWidth: minWidth,
maxWidth: _softWrap || _overflow == TextOverflow.ellipsis ? maxWidth : double.INFINITY
);
}
void _layoutTextWithConstraints(BoxConstraints constraints) {
......
......@@ -132,7 +132,7 @@ void main() {
expect(paragraph.size.height, equals(lineHeight));
relayoutWith(maxLines: 3, softWrap: false, overflow: TextOverflow.ellipsis);
expect(paragraph.size.height, equals(2 * lineHeight));
expect(paragraph.size.height, equals(3 * lineHeight));
relayoutWith(maxLines: null, softWrap: false, overflow: TextOverflow.ellipsis);
expect(paragraph.size.height, equals(2 * lineHeight));
......
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