-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/engine
#28008Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtdependency: dartDart team may need to help usDart team may need to help usengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.5Found to occur in 2.5Found to occur in 2.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
ui.Paragraph.getLineBoundary gives an incorrect response when passed TextAffinity.downstream at a line wrap.
Example
Imagine we're rendering the string "123456789" and our field is very narrow and so the "9" wraps:
|12345678|
|9 |
There are now two TextPositions between the 8 and the 9, one on the first line and one on the second line:
First line: TextPosition(offset: 8, affinity: TextAffinity.upstream)
Second line: TextPosition(offset: 8, affinity: TextAffinity.downstream)
The problem is that getLineBoundary will return a TextRange of 0-8 regardless of which of the above two TextPositions are passed to it. It doesn't use the TextAffinity, only the index, which you can see in the code here.
Metadata
Metadata
Assignees
Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtdependency: dartDart team may need to help usDart team may need to help usengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.5Found to occur in 2.5Found to occur in 2.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version