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
0086243b
Unverified
Commit
0086243b
authored
Sep 19, 2019
by
chunhtai
Committed by
GitHub
Sep 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Selectable text align is broken (#40709)
* Fixed Selectable text align is broken
parent
f8ba6756
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
45 deletions
+54
-45
editable.dart
packages/flutter/lib/src/rendering/editable.dart
+43
-33
selectable_text_test.dart
packages/flutter/test/widgets/selectable_text_test.dart
+11
-12
No files found.
packages/flutter/lib/src/rendering/editable.dart
View file @
0086243b
This diff is collapsed.
Click to expand it.
packages/flutter/test/widgets/selectable_text_test.dart
View file @
0086243b
...
...
@@ -1159,7 +1159,7 @@ void main() {
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
2
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
278
.0
));
expect
(
topLeft
.
dx
,
equals
(
399
.0
));
});
testWidgets
(
'Can align to center within center'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -3477,22 +3477,22 @@ void main() {
Offset
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
4
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
306
));
expect
(
topLeft
.
dx
,
equals
(
427
));
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
3
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
292
));
expect
(
topLeft
.
dx
,
equals
(
413
));
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
2
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
278
));
expect
(
topLeft
.
dx
,
equals
(
399
));
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
1
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
264
));
expect
(
topLeft
.
dx
,
equals
(
385
));
});
testWidgets
(
'Caret indexes into trailing whitespace center align'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -3513,33 +3513,32 @@ void main() {
Offset
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
7
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
362
));
expect
(
topLeft
.
dx
,
equals
(
469
));
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
8
)).
topLeft
,
);
// Caret is capped at text length.
expect
(
topLeft
.
dx
,
equals
(
362
));
expect
(
topLeft
.
dx
,
equals
(
483
));
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
4
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
334
));
expect
(
topLeft
.
dx
,
equals
(
427
));
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
3
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
320
));
expect
(
topLeft
.
dx
,
equals
(
413
));
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
2
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
3
06
));
expect
(
topLeft
.
dx
,
equals
(
3
99
));
topLeft
=
editable
.
localToGlobal
(
editable
.
getLocalRectForCaret
(
const
TextPosition
(
offset:
1
)).
topLeft
,
);
expect
(
topLeft
.
dx
,
equals
(
292
));
expect
(
topLeft
.
dx
,
equals
(
385
));
});
testWidgets
(
'selection handles are rendered and not faded away'
,
(
WidgetTester
tester
)
async
{
...
...
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