Skip to content

Commit

Permalink
## 6.0.6
Browse files Browse the repository at this point in the history
* Fix overflow rect is not right if overflowSelection has no selection(may be empty text).
  • Loading branch information
zmtzawqlp committed May 10, 2021
1 parent 766bd35 commit 51399f6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.0.6

* Fix overflow rect is not right if overflowSelection has no selection(may be empty text).

## 6.0.5

* Remove unnecessary assert (assert(textPainter.width >= lastChild!.size.width))
Expand Down
12 changes: 12 additions & 0 deletions lib/src/text_overflow_render_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,18 @@ mixin TextOverflowMixin on ExtendedTextSelectionRenderObject {
overflowRect.width, _overflowRect!.height);
}
_overflowRect = _overflowRect!.expandToInclude(overflowRect);
} else {
// out _overflowRect and reach rect
if (rect.left >= _overflowRect!.left ||
rect.right <= _overflowRect!.right) {
// see whether in the same line
overflowRect = Rect.fromLTRB(_overflowRect!.left, overflowRect.top,
_overflowRect!.right, overflowRect.bottom);
if (_overflowRect!.overlaps(overflowRect)) {
_overflowRect = _overflowRect!.expandToInclude(overflowRect);
}
go = false;
}
}

// final Rect temp = getTextRect(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: extended_text
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.
version: 6.0.5
version: 6.0.6
homepage: https://github.com/fluttercandies/extended_text

environment:
Expand Down

0 comments on commit 51399f6

Please sign in to comment.