Bug 937343: Spoof a touch start event on pinch end in GestureEventListener r=botond

This commit is contained in:
Doug Sherk 2014-01-24 22:13:10 +00:00
parent df4be65f37
commit 01131fb434

View File

@ -267,25 +267,24 @@ nsEventStatus GestureEventListener::HandlePinchGestureEvent(const MultiTouchInpu
} else if (mState == GESTURE_PINCH) {
PinchGestureInput pinchEvent(PinchGestureInput::PINCHGESTURE_END,
aEvent.mTime,
ScreenPoint(), // may change below
1.0f, // may change below
1.0f, // may change below
ScreenPoint(),
1.0f,
1.0f,
aEvent.modifiers);
if (mTouches.Length() > 0) {
// Pinch is changing to pan. APZC will start a pan at mFocusPoint
// (which isn't really a focus point in this case...).
pinchEvent.mFocusPoint = mTouches[0].mScreenPoint;
} else {
// Pinch is ending, no pan to follow. APZC will check for the spans
// being negative.
pinchEvent.mCurrentSpan = pinchEvent.mPreviousSpan = -1.0f;
}
mAsyncPanZoomController->HandleInputEvent(pinchEvent);
mState = GESTURE_NONE;
// If the user left a finger on the screen, spoof a touch start event and
// send it to APZC so that they can continue panning from that point.
if (mTouches.Length() == 1) {
MultiTouchInput touchEvent(MultiTouchInput::MULTITOUCH_START,
aEvent.mTime,
aEvent.modifiers);
touchEvent.mTouches.AppendElement(mTouches[0]);
mAsyncPanZoomController->HandleInputEvent(touchEvent);
}
rv = nsEventStatus_eConsumeNoDefault;
} else if (mState == GESTURE_WAITING_PINCH) {
mState = GESTURE_NONE;