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
275ec45e
Unverified
Commit
275ec45e
authored
Jan 31, 2020
by
Bogdan Lukin
Committed by
GitHub
Jan 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix material selection handle paint with transparent textSelectionHandleColor (#49830)
parent
b2a27c10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
text_selection.dart
packages/flutter/lib/src/material/text_selection.dart
+4
-2
text_selection_test.dart
packages/flutter/test/material/text_selection_test.dart
+35
-0
No files found.
packages/flutter/lib/src/material/text_selection.dart
View file @
275ec45e
...
...
@@ -120,8 +120,10 @@ class _TextSelectionHandlePainter extends CustomPainter {
void
paint
(
Canvas
canvas
,
Size
size
)
{
final
Paint
paint
=
Paint
()..
color
=
color
;
final
double
radius
=
size
.
width
/
2.0
;
canvas
.
drawCircle
(
Offset
(
radius
,
radius
),
radius
,
paint
);
canvas
.
drawRect
(
Rect
.
fromLTWH
(
0.0
,
0.0
,
radius
,
radius
),
paint
);
final
Rect
circle
=
Rect
.
fromCircle
(
center:
Offset
(
radius
,
radius
),
radius:
radius
);
final
Rect
point
=
Rect
.
fromLTWH
(
0.0
,
0.0
,
radius
,
radius
);
final
Path
path
=
Path
()..
addOval
(
circle
)..
addRect
(
point
);
canvas
.
drawPath
(
path
,
paint
);
}
@override
...
...
packages/flutter/test/material/text_selection_test.dart
View file @
275ec45e
...
...
@@ -62,4 +62,39 @@ void main() {
expect
(
materialTextSelectionControls
.
canSelectAll
(
key
.
currentState
),
false
);
});
});
group
(
'material handles'
,
()
{
testWidgets
(
'draws transparent handle correctly'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
child:
Theme
(
data:
ThemeData
(
textSelectionHandleColor:
const
Color
(
0x550000AA
),
),
isMaterialAppTheme:
true
,
child:
Builder
(
builder:
(
BuildContext
context
)
{
return
Container
(
color:
Colors
.
white
,
height:
800
,
width:
800
,
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
250
),
child:
FittedBox
(
child:
materialTextSelectionControls
.
buildHandle
(
context
,
TextSelectionHandleType
.
right
,
10.0
,
),
),
),
);
},
),
),
));
await
expectLater
(
find
.
byType
(
RepaintBoundary
),
matchesGoldenFile
(
'transparent_handle.png'
),
);
});
});
}
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