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
1c13d665
Unverified
Commit
1c13d665
authored
May 14, 2020
by
LongCatIsLooong
Committed by
GitHub
May 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove redundant transform (#57085)
parent
8a77381e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletion
+50
-1
viewport.dart
packages/flutter/lib/src/rendering/viewport.dart
+0
-1
viewport_test.dart
packages/flutter/test/rendering/viewport_test.dart
+50
-0
No files found.
packages/flutter/lib/src/rendering/viewport.dart
View file @
1c13d665
...
...
@@ -783,7 +783,6 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
final
double
offsetDifference
=
offset
.
pixels
-
targetOffset
;
final
Matrix4
transform
=
target
.
getTransformTo
(
this
);
applyPaintTransform
(
child
,
transform
);
Rect
targetRect
=
MatrixUtils
.
transformRect
(
transform
,
rect
);
switch
(
axisDirection
)
{
...
...
packages/flutter/test/rendering/viewport_test.dart
View file @
1c13d665
...
...
@@ -986,6 +986,56 @@ void main() {
expect
(
controller
.
offset
,
300.0
);
});
testWidgets
(
'RenderViewportBase.showOnScreen reports the correct targetRect'
,
(
WidgetTester
tester
)
async
{
final
ScrollController
innerController
=
ScrollController
();
final
ScrollController
outerController
=
ScrollController
();
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Center
(
child:
Container
(
height:
300.0
,
child:
CustomScrollView
(
cacheExtent:
0
,
controller:
outerController
,
slivers:
<
Widget
>[
SliverToBoxAdapter
(
child:
Container
(
height:
300
,
child:
CustomScrollView
(
controller:
innerController
,
slivers:
List
<
Widget
>.
generate
(
5
,
(
int
i
)
{
return
SliverToBoxAdapter
(
child:
SizedBox
(
height:
300.0
,
child:
Text
(
'Tile
$i
'
),
),
);
}),
),
),
),
const
SliverToBoxAdapter
(
child:
SizedBox
(
height:
300.0
,
child:
Text
(
'hidden'
),
),
),
],
),
),
),
),
);
tester
.
renderObject
(
find
.
widgetWithText
(
SizedBox
,
'Tile 1'
,
skipOffstage:
false
)).
showOnScreen
();
await
tester
.
pumpAndSettle
();
// The inner viewport scrolls to reveal the 2nd tile.
expect
(
innerController
.
offset
,
300.0
);
expect
(
outerController
.
offset
,
0
);
});
group
(
'unbounded constraints control test'
,
()
{
Widget
buildNestedWidget
([
Axis
a1
=
Axis
.
vertical
,
Axis
a2
=
Axis
.
horizontal
])
{
return
Directionality
(
...
...
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