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
549b4126
Unverified
Commit
549b4126
authored
May 10, 2019
by
Jonah Williams
Committed by
GitHub
May 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Add more asserts to check matrix validity (#31701)" (#32496)
parent
0dc290c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
16 deletions
+6
-16
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+1
-2
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+1
-3
proxy_box_test.dart
packages/flutter/test/rendering/proxy_box_test.dart
+4
-11
No files found.
packages/flutter/lib/src/rendering/layer.dart
View file @
549b4126
...
...
@@ -1228,8 +1228,7 @@ class TransformLayer extends OffsetLayer {
/// The [transform] and [offset] properties must be non-null before the
/// compositing phase of the pipeline.
TransformLayer
({
Matrix4
transform
,
Offset
offset
=
Offset
.
zero
})
:
assert
(
transform
.
storage
.
every
((
double
value
)
=>
value
.
isFinite
)),
_transform
=
transform
,
:
_transform
=
transform
,
super
(
offset:
offset
);
/// The matrix to apply.
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
549b4126
...
...
@@ -2280,11 +2280,9 @@ class RenderFittedBox extends RenderProxyBox {
final
Rect
sourceRect
=
_resolvedAlignment
.
inscribe
(
sizes
.
source
,
Offset
.
zero
&
childSize
);
final
Rect
destinationRect
=
_resolvedAlignment
.
inscribe
(
sizes
.
destination
,
Offset
.
zero
&
size
);
_hasVisualOverflow
=
sourceRect
.
width
<
childSize
.
width
||
sourceRect
.
height
<
childSize
.
height
;
assert
(
scaleX
.
isFinite
&&
scaleY
.
isFinite
);
_transform
=
Matrix4
.
translationValues
(
destinationRect
.
left
,
destinationRect
.
top
,
0.0
)
..
scale
(
scaleX
,
scaleY
,
1.0
)
..
translate
(-
sourceRect
.
left
,
-
sourceRect
.
top
);
assert
(
_transform
.
storage
.
every
((
double
value
)
=>
value
.
isFinite
));
}
}
...
...
@@ -2298,7 +2296,7 @@ class RenderFittedBox extends RenderProxyBox {
@override
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
if
(
size
.
isEmpty
||
child
.
size
.
isEmpty
)
if
(
size
.
isEmpty
)
return
;
_updatePaintData
();
if
(
child
!=
null
)
{
...
...
packages/flutter/test/rendering/proxy_box_test.dart
View file @
549b4126
...
...
@@ -15,12 +15,11 @@ import '../flutter_test_alternative.dart';
import
'rendering_tester.dart'
;
void
main
(
)
{
test
(
'RenderFittedBox
does not paint with empty sizes
'
,
()
{
test
(
'RenderFittedBox
paint
'
,
()
{
bool
painted
;
RenderFittedBox
makeFittedBox
(
Size
size
)
{
RenderFittedBox
makeFittedBox
()
{
return
RenderFittedBox
(
child:
RenderCustomPaint
(
preferredSize:
size
,
painter:
TestCallbackPainter
(
onPaint:
()
{
painted
=
true
;
}),
...
...
@@ -28,19 +27,13 @@ void main() {
);
}
// The RenderFittedBox paints if both its size and its child's size are nonempty.
painted
=
false
;
layout
(
makeFittedBox
(
Size
(
1
,
1
)
),
phase:
EnginePhase
.
paint
);
layout
(
makeFittedBox
(),
phase:
EnginePhase
.
paint
);
expect
(
painted
,
equals
(
true
));
// The RenderFittedBox should not paint if its child is empty-sized.
painted
=
false
;
layout
(
makeFittedBox
(
Size
.
zero
),
phase:
EnginePhase
.
paint
);
expect
(
painted
,
equals
(
false
));
// The RenderFittedBox should not paint if it is empty.
painted
=
false
;
layout
(
makeFittedBox
(
Size
(
1
,
1
)
),
constraints:
BoxConstraints
.
tight
(
Size
.
zero
),
phase:
EnginePhase
.
paint
);
layout
(
makeFittedBox
(),
constraints:
BoxConstraints
.
tight
(
Size
.
zero
),
phase:
EnginePhase
.
paint
);
expect
(
painted
,
equals
(
false
));
});
...
...
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