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
f4a6b218
Unverified
Commit
f4a6b218
authored
Apr 08, 2021
by
xubaolin
Committed by
GitHub
Apr 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a rotation gesture bug (#79035)
parent
e4ad46c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
scale.dart
packages/flutter/lib/src/gestures/scale.dart
+1
-1
scale_test.dart
packages/flutter/test/gestures/scale_test.dart
+28
-0
No files found.
packages/flutter/lib/src/gestures/scale.dart
View file @
f4a6b218
...
@@ -441,7 +441,7 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
...
@@ -441,7 +441,7 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
pointerEndId:
_pointerQueue
[
1
],
pointerEndId:
_pointerQueue
[
1
],
pointerEndLocation:
_pointerLocations
[
_pointerQueue
[
1
]]!,
pointerEndLocation:
_pointerLocations
[
_pointerQueue
[
1
]]!,
);
);
_currentLine
=
null
;
_currentLine
=
_initialLine
;
}
}
}
}
...
...
packages/flutter/test/gestures/scale_test.dart
View file @
f4a6b218
...
@@ -572,6 +572,34 @@ void main() {
...
@@ -572,6 +572,34 @@ void main() {
tap
.
dispose
();
tap
.
dispose
();
});
});
// Regressing test for https://github.com/flutter/flutter/issues/78941
testGesture
(
'First rotation test'
,
(
GestureTester
tester
)
{
final
ScaleGestureRecognizer
scale
=
ScaleGestureRecognizer
();
double
?
updatedRotation
;
scale
.
onUpdate
=
(
ScaleUpdateDetails
details
)
{
updatedRotation
=
details
.
rotation
;
};
final
TestPointer
pointer1
=
TestPointer
(
1
);
final
PointerDownEvent
down
=
pointer1
.
down
(
Offset
.
zero
);
scale
.
addPointer
(
down
);
tester
.
closeArena
(
1
);
tester
.
route
(
down
);
final
TestPointer
pointer2
=
TestPointer
(
2
);
final
PointerDownEvent
down2
=
pointer2
.
down
(
const
Offset
(
10.0
,
10.0
));
scale
.
addPointer
(
down2
);
tester
.
closeArena
(
2
);
tester
.
route
(
down2
);
expect
(
updatedRotation
,
isNull
);
// Rotation 45°.
tester
.
route
(
pointer2
.
move
(
const
Offset
(
0.0
,
10.0
)));
expect
(
updatedRotation
,
math
.
pi
/
4.0
);
});
testGesture
(
'Scale gestures pointer count test'
,
(
GestureTester
tester
)
{
testGesture
(
'Scale gestures pointer count test'
,
(
GestureTester
tester
)
{
final
ScaleGestureRecognizer
scale
=
ScaleGestureRecognizer
();
final
ScaleGestureRecognizer
scale
=
ScaleGestureRecognizer
();
...
...
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