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
8ab513a0
Unverified
Commit
8ab513a0
authored
Jun 30, 2020
by
Justin McCandless
Committed by
GitHub
Jun 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InteractiveViewer scroll direction (#60523)
parent
c543db70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
interactive_viewer.dart
packages/flutter/lib/src/widgets/interactive_viewer.dart
+1
-1
gesture_utils.dart
packages/flutter/test/widgets/gesture_utils.dart
+2
-2
interactive_viewer_test.dart
packages/flutter/test/widgets/interactive_viewer_test.dart
+2
-2
No files found.
packages/flutter/lib/src/widgets/interactive_viewer.dart
View file @
8ab513a0
...
...
@@ -848,7 +848,7 @@ class _InteractiveViewerState extends State<InteractiveViewer> with TickerProvid
if
(
event
is
PointerScrollEvent
)
{
final
RenderBox
childRenderBox
=
_childKey
.
currentContext
.
findRenderObject
()
as
RenderBox
;
final
Size
childSize
=
childRenderBox
.
size
;
final
double
scaleChange
=
1.0
+
event
.
scrollDelta
.
dy
/
childSize
.
height
;
final
double
scaleChange
=
1.0
-
event
.
scrollDelta
.
dy
/
childSize
.
height
;
if
(
scaleChange
==
0.0
)
{
return
;
}
...
...
packages/flutter/test/widgets/gesture_utils.dart
View file @
8ab513a0
...
...
@@ -7,10 +7,10 @@
import
'package:flutter/gestures.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
Future
<
void
>
scrollAt
(
Offset
position
,
WidgetTester
tester
)
{
Future
<
void
>
scrollAt
(
Offset
position
,
WidgetTester
tester
,
[
Offset
offset
=
const
Offset
(
0.0
,
20.0
)]
)
{
final
TestPointer
testPointer
=
TestPointer
(
1
,
PointerDeviceKind
.
mouse
);
// Create a hover event so that |testPointer| has a location when generating the scroll.
testPointer
.
hover
(
position
);
final
HitTestResult
result
=
tester
.
hitTestOnBinding
(
position
);
return
tester
.
sendEventToBinding
(
testPointer
.
scroll
(
const
Offset
(
0.0
,
20.0
)
),
result
);
return
tester
.
sendEventToBinding
(
testPointer
.
scroll
(
offset
),
result
);
}
packages/flutter/test/widgets/interactive_viewer_test.dart
View file @
8ab513a0
...
...
@@ -422,7 +422,7 @@ void main() {
);
final
Offset
center
=
tester
.
getCenter
(
find
.
byType
(
InteractiveViewer
));
await
scrollAt
(
center
,
tester
);
await
scrollAt
(
center
,
tester
,
const
Offset
(
0.0
,
-
20.0
)
);
await
tester
.
pumpAndSettle
();
expect
(
transformationController
.
value
.
getMaxScaleOnAxis
(),
greaterThan
(
1.0
));
...
...
@@ -445,7 +445,7 @@ void main() {
);
final
Offset
center
=
tester
.
getCenter
(
find
.
byType
(
InteractiveViewer
));
await
scrollAt
(
center
,
tester
);
await
scrollAt
(
center
,
tester
,
const
Offset
(
0.0
,
-
20.0
)
);
await
tester
.
pumpAndSettle
();
expect
(
transformationController
.
value
.
getMaxScaleOnAxis
(),
equals
(
1.0
));
...
...
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