-
-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix of rotation and pinch gesture on android #2983
Changes from 4 commits
ae06290
5b30e8c
cbf3771
5e820d6
2df344c
c8716e3
c98b9b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ class PinchGestureHandler : GestureHandler<PinchGestureHandler>() { | |
if (sourceEvent.actionMasked == MotionEvent.ACTION_POINTER_UP) { | ||
activePointers -= 1 | ||
} | ||
if (state == STATE_ACTIVE && activePointers < 2) { | ||
if (state == STATE_ACTIVE && activePointers == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you check which state the gesture goes to after lifting all the fingers? I'm not sure whether this branch will get evaluated in this form ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct, this if statement is useless at this point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it can be simply changed to something like this:
|
||
end() | ||
} else if (sourceEvent.actionMasked == MotionEvent.ACTION_UP) { | ||
fail() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ class RotationGestureHandler : GestureHandler<RotationGestureHandler>() { | |
anchorY = point.y | ||
} | ||
if (sourceEvent.actionMasked == MotionEvent.ACTION_UP) { | ||
if (state == STATE_ACTIVE) { | ||
if (state == STATE_ACTIVE && sourceEvent.pointerCount == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change necessary? I think it's the same as with pinch - |
||
end() | ||
} else { | ||
fail() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
activePointers
is being used anymore, can you remove it?