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
This commit is contained in:
parent
a657428b5c
commit
da7867be0e
@ -98,7 +98,7 @@ class RenderParagraph extends RenderBox {
|
|||||||
return;
|
return;
|
||||||
_overflow = value;
|
_overflow = value;
|
||||||
_textPainter.ellipsis = value == TextOverflow.ellipsis ? _kEllipsis : null;
|
_textPainter.ellipsis = value == TextOverflow.ellipsis ? _kEllipsis : null;
|
||||||
markNeedsPaint();
|
markNeedsLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The number of font pixels for each logical pixel.
|
/// The number of font pixels for each logical pixel.
|
||||||
|
@ -140,6 +140,10 @@ void main() {
|
|||||||
relayoutWith(maxLines: 3, softWrap: true, overflow: TextOverflow.fade);
|
relayoutWith(maxLines: 3, softWrap: true, overflow: TextOverflow.fade);
|
||||||
expect(paragraph.debugHasOverflowShader, isTrue);
|
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);
|
relayoutWith(maxLines: 100, softWrap: true, overflow: TextOverflow.fade);
|
||||||
expect(paragraph.debugHasOverflowShader, isFalse);
|
expect(paragraph.debugHasOverflowShader, isFalse);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user