-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Reverts "Make TextSpan hit testing precise."
#140468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
auto-submit
merged 1 commit into
master
from
revert_ea5b97286e5347ec3f6adb32eb22256e7aa5bd5a
Dec 20, 2023
Merged
Reverts "Make TextSpan hit testing precise."
#140468
auto-submit
merged 1 commit into
master
from
revert_ea5b97286e5347ec3f6adb32eb22256e7aa5bd5a
Dec 20, 2023
Conversation
This file contains hidden or 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 reverts commit ea5b972.
fluttergithubbot
approved these changes
Dec 20, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 21, 2023
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this pull request
Dec 21, 2023
flutter/flutter@da0cd69...11def8e 2023-12-21 [email protected] Update README.md (flutter/flutter#140382) 2023-12-21 [email protected] Revert "Integrate testWidgets with leak tracking. (#138057)" (flutter/flutter#140502) 2023-12-21 [email protected] Integrate testWidgets with leak tracking. (flutter/flutter#138057) 2023-12-21 [email protected] Fix import pattern (flutter/flutter#140425) 2023-12-20 [email protected] Update job permissions (flutter/flutter#140476) 2023-12-20 [email protected] Roll pub packages (flutter/flutter#140472) 2023-12-20 [email protected] Remove outdated ignores from tool (flutter/flutter#140467) 2023-12-20 [email protected] Remove outdated ignores from framework (flutter/flutter#140465) 2023-12-20 [email protected] Reland `find.textRange.ofSubstring` changes (flutter/flutter#140469) 2023-12-20 [email protected] Part 1/n migration steps for kotlin migration (flutter/flutter#140452) 2023-12-20 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Make `TextSpan` hit testing precise." (flutter/flutter#140468) 2023-12-20 [email protected] [web] Re-enable test now that source of flakiness is fixed (flutter/flutter#140462) 2023-12-20 [email protected] Eliminate Cirrus build status badge (flutter/flutter#140461) 2023-12-20 [email protected] Move tests shifted to Pixel 7 from staging to prod (flutter/flutter#140438) 2023-12-20 [email protected] Roll Packages from be52ac8 to dc5b267 (5 revisions) (flutter/flutter#140450) 2023-12-20 [email protected] _TabBarViewState should not recreate page controller (flutter/flutter#135500) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LongCatIsLooong
added a commit
to LongCatIsLooong/flutter
that referenced
this pull request
Dec 26, 2023
This reverts commit 9003f13.
CoderDake
pushed a commit
to CoderDake/flutter
that referenced
this pull request
Dec 28, 2023
Reverts flutter#139717 Initiated by: LongCatIsLooong This change reverts the following previous change: Original Description: Fixes flutter#131435, flutter#104594, flutter#43400 Needs flutter/engine#48774 (to fix the web test failure). Currently the method we use for text span hit testing `TextPainter.getPositionForOffset` always returns the closest `TextPosition`, even when the given offset is far away from the text. The new TextPaintes method tells you the layout bounds (`width = letterspacing / 2 + x_advance + letterspacing / 2`, `height = font ascent + font descent`) of a character, the PR changes the hit testing implementation such that a TextSpan is only considered hit if the point-down event landed in one of it's character's layout bounds. Potential issues: 1. In theory since the text is baseline aligned, we should use the max ascent and max descent of each character to calculate the height of the text span's hit-test region, in case some characters in the span have to fall back to a different font, but that will be slower and it typically doesn't make a huge difference. This is a breaking change. It also introduces a new finder and a new method `WidgetTester.tapOnText`: `await tester.tapOnText('string to match')` for ease of migration.
auto-submit bot
pushed a commit
that referenced
this pull request
Jan 2, 2024
Fixes #131435, #104594, #43400 Currently the method we use for text span hit testing `TextPainter.getPositionForOffset` always returns the closest `TextPosition`, even when the given offset is far away from the text. The new TextPaintes method tells you the layout bounds `(width = letterspacing / 2 + x_advance + letterspacing / 2, height = font ascent + font descent)` of a character, the PR changes the hit testing implementation such that a TextSpan is only considered hit if the point-down event landed in one of its character's layout bounds. Potential issues: In theory since the text is baseline aligned, we should use the max ascent and max descent of each character to calculate the height of the text span's hit-test region, in case some characters in the span have to fall back to a different font, but that will be slower and it typically doesn't make a huge difference. This is a breaking change.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
a: tests
"flutter test", flutter_test, or one of our tests
a: text input
Entering text in a text field or keyboard related problems
f: scrolling
Viewports, list views, slivers, etc.
framework
flutter/packages/flutter repository. See also f: labels.
revert of
Bot Only: Tracking label for bot. Tracks new revert of pull requests.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #139717
Initiated by: LongCatIsLooong
This change reverts the following previous change:
Original Description:
Fixes #131435, #104594, #43400
Needs flutter/engine#48774 (to fix the web test failure).
Currently the method we use for text span hit testing
TextPainter.getPositionForOffsetalways returns the closestTextPosition, even when the given offset is far away from the text.The new TextPaintes method tells you the layout bounds (
width = letterspacing / 2 + x_advance + letterspacing / 2,height = font ascent + font descent) of a character, the PR changes the hit testing implementation such that a TextSpan is only considered hit if the point-down event landed in one of it's character's layout bounds.Potential issues:
This is a breaking change. It also introduces a new finder and a new method
WidgetTester.tapOnText:await tester.tapOnText('string to match')for ease of migration.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.