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
4f964196
Unverified
Commit
4f964196
authored
May 14, 2022
by
Dan Field
Committed by
GitHub
May 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make _RenderCustomClip respect clipBehavior (#103748)
parent
8c4e92c6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+9
-2
proxy_box_test.dart
packages/flutter/test/rendering/proxy_box_test.dart
+25
-0
No files found.
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
4f964196
...
...
@@ -1404,9 +1404,16 @@ abstract class _RenderCustomClip<T> extends RenderProxyBox {
}
@override
Rect
describeApproximatePaintClip
(
RenderObject
child
)
{
Rect
?
describeApproximatePaintClip
(
RenderObject
child
)
{
switch
(
clipBehavior
)
{
case
Clip
.
none
:
return
null
;
case
Clip
.
hardEdge
:
case
Clip
.
antiAlias
:
case
Clip
.
antiAliasWithSaveLayer
:
return
_clipper
?.
getApproximateClipRect
(
size
)
??
Offset
.
zero
&
size
;
}
}
Paint
?
_debugPaint
;
TextPainter
?
_debugText
;
...
...
packages/flutter/test/rendering/proxy_box_test.dart
View file @
4f964196
...
...
@@ -686,6 +686,31 @@ void main() {
expect
(()
=>
pumpFrame
(
phase:
EnginePhase
.
composite
),
returnsNormally
);
});
test
(
'RenderCustomClip extenders respect clipBehavior when asked to describeApproximateClip'
,
()
{
final
RenderBox
child
=
RenderConstrainedBox
(
additionalConstraints:
const
BoxConstraints
.
tightFor
(
width:
200
,
height:
200
));
final
RenderClipRect
renderClipRect
=
RenderClipRect
(
clipBehavior:
Clip
.
none
,
child:
child
);
layout
(
renderClipRect
);
expect
(
renderClipRect
.
describeApproximatePaintClip
(
child
),
null
,
);
renderClipRect
.
clipBehavior
=
Clip
.
hardEdge
;
expect
(
renderClipRect
.
describeApproximatePaintClip
(
child
),
Offset
.
zero
&
renderClipRect
.
size
,
);
renderClipRect
.
clipBehavior
=
Clip
.
antiAlias
;
expect
(
renderClipRect
.
describeApproximatePaintClip
(
child
),
Offset
.
zero
&
renderClipRect
.
size
,
);
renderClipRect
.
clipBehavior
=
Clip
.
antiAliasWithSaveLayer
;
expect
(
renderClipRect
.
describeApproximatePaintClip
(
child
),
Offset
.
zero
&
renderClipRect
.
size
,
);
});
}
class
_TestRectClipper
extends
CustomClipper
<
Rect
>
{
...
...
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