File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed
Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 11## 15.0.1
22
33* Fix issue that setState() causes custom overflow to disappear(#171 )
4+ * Fix issue that can' find no overflow(#167 ,#174 )
45
56## 15.0.0
67
Original file line number Diff line number Diff line change @@ -455,12 +455,17 @@ mixin TextOverflowMixin on _RenderParagraph {
455455
456456 if (_hasVisualOverflow) {
457457 // not find
458- assert (range.end != maxOffset, 'can\' find no overflow' );
458+ // assert(range.end != maxOffset, 'can\' find no overflow');
459+ final _TextRange pre = range.copyWith ();
459460 range.end = math.min (
460- range.end + 1
461- // math.max((maxEnd - range.end) ~/ 2, 1)
462- ,
463- maxOffset);
461+ // range.end + 1,
462+ range.end + math.max ((maxEnd - range.end) ~ / 2 , 1 ),
463+ maxOffset,
464+ );
465+ if (pre == range) {
466+ _hasVisualOverflow = false ;
467+ break ;
468+ }
464469 hideWidgets.clear ();
465470 } else {
466471 // see pre one whether overflow
@@ -477,12 +482,11 @@ mixin TextOverflowMixin on _RenderParagraph {
477482 } else {
478483 maxEnd = range.end;
479484 range.end = math.max (
480- range.start,
481- maxEnd - 1 ,
482- // math.min(
483- // math.max((maxEnd - range.start) ~/ 2, 1),
484- // maxEnd)
485- );
485+ range.start,
486+ // maxEnd - 1,
487+ math.min (
488+ maxEnd - math.max ((maxEnd - range.start) ~ / 2 , 1 ), maxEnd));
489+
486490 // if range is not changed, so maybe we should break.
487491 if (pre == range) {
488492 _hasVisualOverflow = false ;
You can’t perform that action at this time.
0 commit comments