File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 22
33* Fix issue that setState() causes custom overflow to disappear(#171 )
44* Fix issue that can' find no overflow(#167 ,#174 )
5+ * Fix issue that OverflowWidget not work well when the size of window is changing.
56
67## 15.0.0
78
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ class ExtendedRenderParagraph extends _RenderParagraph
5353 _overflowWidget = overflowWidget;
5454 _canSelectPlaceholderSpan = canSelectPlaceholderSpan;
5555 _gradientConfig = gradientConfig;
56+ _textCache = text;
5657 }
5758
5859 @override
@@ -103,6 +104,9 @@ class ExtendedRenderParagraph extends _RenderParagraph
103104 ChildLayoutHelper .layoutChild,
104105 ChildLayoutHelper .getBaseline,
105106 );
107+ if (_textPainter.text != _textCache && _constraints != constraints) {
108+ _textPainter.text = _textCache;
109+ }
106110 _layoutTextWithConstraints (constraints);
107111 positionInlineChildren (_textPainter.inlinePlaceholderBoxes! );
108112
@@ -175,6 +179,7 @@ class ExtendedRenderParagraph extends _RenderParagraph
175179 _disposeSelectableFragments ();
176180 _updateSelectionRegistrarSubscription ();
177181 }
182+ _constraints = constraints;
178183 }
179184
180185 @override
Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ mixin TextOverflowMixin on _RenderParagraph {
6666 markNeedsLayout ();
6767 }
6868
69+ BoxConstraints ? _constraints;
70+ InlineSpan ? _textCache;
71+
72+ @override
73+ set text (InlineSpan value) {
74+ _textCache = value;
75+ super .text = value;
76+ }
77+
6978 void layoutOverflow () {
7079 // final bool didOverflowWidth = _didVisualOverflow();
7180 // layoutOfficalOverflow(didOverflowWidth);
@@ -147,7 +156,9 @@ mixin TextOverflowMixin on _RenderParagraph {
147156 final Size overflowWidgetSize = lastChild! .size;
148157 final TextOverflowPosition position = overflowWidget! .position;
149158
150- final TextPainter oneLineTextPainter = _copyTextPainter ();
159+ final TextPainter oneLineTextPainter = _copyTextPainter (
160+ inlineSpan: _textCache,
161+ );
151162
152163 final List <PlaceholderDimensions > placeholderDimensions =
153164 layoutInlineChildren (
You can’t perform that action at this time.
0 commit comments