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

Request a layout when a paragraph's overflow mode is changed (#9485)

A change in overflow mode requires calculation of the text size and resetting
the overflow shader
parent a657428b
......@@ -98,7 +98,7 @@ class RenderParagraph extends RenderBox {
return;
_overflow = value;
_textPainter.ellipsis = value == TextOverflow.ellipsis ? _kEllipsis : null;
markNeedsPaint();
markNeedsLayout();
}
/// The number of font pixels for each logical pixel.
......
......@@ -140,6 +140,10 @@ void main() {
relayoutWith(maxLines: 3, softWrap: true, overflow: TextOverflow.fade);
expect(paragraph.debugHasOverflowShader, isTrue);
// Change back to ellipsis and check that the fade shader is cleared.
relayoutWith(maxLines: 3, softWrap: true, overflow: TextOverflow.ellipsis);
expect(paragraph.debugHasOverflowShader, isFalse);
relayoutWith(maxLines: 100, softWrap: true, overflow: TextOverflow.fade);
expect(paragraph.debugHasOverflowShader, isFalse);
});
......
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