зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1181703 - Allow re-entering the panning state if a second finger is tapped while panning with one finger. r=botond
--HG-- extra : commitid : GdPNUwhizt3
This commit is contained in:
Родитель
1556e9f10e
Коммит
611c8c5b0b
|
@ -1337,10 +1337,18 @@ nsEventStatus AsyncPanZoomController::OnTouchEnd(const MultiTouchInput& aEvent)
|
|||
// that were not big enough to trigger scrolling. Clear that out.
|
||||
mX.SetVelocity(0);
|
||||
mY.SetVelocity(0);
|
||||
// It's possible we may be overscrolled if the user tapped during a
|
||||
// previous overscroll pan. Make sure to snap back in this situation.
|
||||
if (!SnapBackIfOverscrolled()) {
|
||||
SetState(NOTHING);
|
||||
APZC_LOG("%p still has %u touch points active\n", this,
|
||||
CurrentTouchBlock()->GetActiveTouchCount());
|
||||
// In cases where the user is panning, then taps the second finger without
|
||||
// entering a pinch, we will arrive here when the second finger is lifted.
|
||||
// However the first finger is still down so we want to remain in state
|
||||
// TOUCHING.
|
||||
if (CurrentTouchBlock()->GetActiveTouchCount() == 0) {
|
||||
// It's possible we may be overscrolled if the user tapped during a
|
||||
// previous overscroll pan. Make sure to snap back in this situation.
|
||||
if (!SnapBackIfOverscrolled()) {
|
||||
SetState(NOTHING);
|
||||
}
|
||||
}
|
||||
return nsEventStatus_eIgnore;
|
||||
|
||||
|
|
|
@ -861,5 +861,11 @@ TouchBlockState::UpdateSlopState(const MultiTouchInput& aInput,
|
|||
return mInSlop;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
TouchBlockState::GetActiveTouchCount() const
|
||||
{
|
||||
return mTouchCounter.GetActiveTouchCount();
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -442,6 +442,11 @@ public:
|
|||
bool UpdateSlopState(const MultiTouchInput& aInput,
|
||||
bool aApzcCanConsumeEvents);
|
||||
|
||||
/**
|
||||
* Returns the number of touch points currently active.
|
||||
*/
|
||||
uint32_t GetActiveTouchCount() const;
|
||||
|
||||
bool HasEvents() const override;
|
||||
void DropEvents() override;
|
||||
void HandleEvents() override;
|
||||
|
|
Загрузка…
Ссылка в новой задаче