mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 937343: Spoof a touch start event on pinch end in GestureEventListener r=botond
This commit is contained in:
parent
df4be65f37
commit
01131fb434
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user