forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RenderParagraph
s _SelectableFragment.boundingBoxes
should conside…
…r max line height (flutter#155892) Fixes flutter#133637 This change updates the `_SelectableFragment.boundingBoxes` logic to consider the max line height. Previously we were using boxes that were tightly bound around each glyph, so you would have to click within the bounds of the glyph for double tap to select word to work. This is different than `SelectableText` which considers the max line height, as well as the native web behavior that also considers the max line height. ## Web https://github.com/user-attachments/assets/4ce8c0ca-ec6f-4969-88b1-baa356be8278 ## Flutter SelectableText https://github.com/user-attachments/assets/54c22ad3-75d7-475b-856b-e9b2dbe09d54 ## Flutter Text widget under SelectionArea https://github.com/user-attachments/assets/27db0e2b-1d19-43cc-8ab3-16050e3a5bc7 After this change, Flutter's Text widget under a SelectionArea now matches the SelectableText and native web behavior. This change also: * Invalidates the cached bounding boxes when the paragraph layout changes. * Updates `textOffsetToPosition` to consider `preferredLineHeight`. In cases when the text wraps, it was sometimes inaccurate.
- Loading branch information
1 parent
711dc06
commit a6141f6
Showing
2 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters