Skip to content

Commit 51399f6

Browse files
committed
## 6.0.6
* Fix overflow rect is not right if overflowSelection has no selection(may be empty text).
1 parent 766bd35 commit 51399f6

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.0.6
2+
3+
* Fix overflow rect is not right if overflowSelection has no selection(may be empty text).
4+
15
## 6.0.5
26

37
* Remove unnecessary assert (assert(textPainter.width >= lastChild!.size.width))

lib/src/text_overflow_render_mixin.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ mixin TextOverflowMixin on ExtendedTextSelectionRenderObject {
387387
overflowRect.width, _overflowRect!.height);
388388
}
389389
_overflowRect = _overflowRect!.expandToInclude(overflowRect);
390+
} else {
391+
// out _overflowRect and reach rect
392+
if (rect.left >= _overflowRect!.left ||
393+
rect.right <= _overflowRect!.right) {
394+
// see whether in the same line
395+
overflowRect = Rect.fromLTRB(_overflowRect!.left, overflowRect.top,
396+
_overflowRect!.right, overflowRect.bottom);
397+
if (_overflowRect!.overlaps(overflowRect)) {
398+
_overflowRect = _overflowRect!.expandToInclude(overflowRect);
399+
}
400+
go = false;
401+
}
390402
}
391403

392404
// final Rect temp = getTextRect(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: extended_text
22
description: Extended official text to build special text like inline image or @somebody quickly,it also support custom background,custom over flow and custom selection toolbar and handles.
3-
version: 6.0.5
3+
version: 6.0.6
44
homepage: https://github.com/fluttercandies/extended_text
55

66
environment:

0 commit comments

Comments
 (0)