Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
3979dafa
Unverified
Commit
3979dafa
authored
Dec 07, 2017
by
Jason Simmons
Committed by
GitHub
Dec 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix calculation of downstream caret location at the end of a string (#13426)
parent
38c82ea8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
text_painter.dart
packages/flutter/lib/src/painting/text_painter.dart
+1
-1
text_painter_rtl_test.dart
packages/flutter/test/painting/text_painter_rtl_test.dart
+1
-2
No files found.
packages/flutter/lib/src/painting/text_painter.dart
View file @
3979dafa
...
...
@@ -416,7 +416,7 @@ class TextPainter {
}
Offset
_getOffsetFromDownstream
(
int
offset
,
Rect
caretPrototype
)
{
final
int
nextCodeUnit
=
_text
.
codeUnitAt
(
offset
+
1
);
final
int
nextCodeUnit
=
_text
.
codeUnitAt
(
offset
);
if
(
nextCodeUnit
==
null
)
return
null
;
final
int
nextRuneOffset
=
_isUtf16Surrogate
(
nextCodeUnit
)
?
offset
+
2
:
offset
+
1
;
...
...
packages/flutter/test/painting/text_painter_rtl_test.dart
View file @
3979dafa
...
...
@@ -287,7 +287,6 @@ void main() {
expect
(
// between A and Alef, before the Alef
painter
.
getOffsetForCaret
(
const
TextPosition
(
offset:
1
,
affinity:
TextAffinity
.
downstream
),
Rect
.
zero
),
const
Offset
(
10.0
,
10.0
),
skip:
skipExpectsWithKnownBugs
,
// this ends up on the wrong line currently - this is a major bug
);
expect
(
// after the Alef
...
...
@@ -318,7 +317,7 @@ void main() {
const
TextBox
.
fromLTRBD
(
0.0
,
10.0
,
10.0
,
20.0
,
TextDirection
.
rtl
),
// Alef
],
);
}
,
skip:
skipTestsWithKnownBugs
);
});
test
(
'TextPainter - line wrap mid-word'
,
()
{
final
TextPainter
painter
=
new
TextPainter
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment