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:
Kartikaya Gupta 2015-11-22 08:57:45 -05:00
Родитель 1556e9f10e
Коммит 611c8c5b0b
3 изменённых файлов: 23 добавлений и 4 удалений

Просмотреть файл

@ -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;