Skip to content
Snippets Groups Projects
Commit c08ac5b4 authored by Markus Stange's avatar Markus Stange
Browse files

Bug 1229125 - Reset velocity in OnPanEnd if there's nowhere to scroll. r=botond

--HG--
extra : commitid : 52Vm5QAFKyD
extra : rebase_source : 54e8561aa8096ccfe404cbe8b2861f12e4075f71
parent 48f438e8
No related branches found
No related tags found
No related merge requests found
......@@ -1919,6 +1919,19 @@ nsEventStatus AsyncPanZoomController::OnPanEnd(const PanGestureInput& aEvent) {
mX.EndTouch(aEvent.mTime);
mY.EndTouch(aEvent.mTime);
// Drop any velocity on axes where we don't have room to scroll anyways
// (in this APZC, or an APZC further in the handoff chain).
// This ensures that we don't enlarge the display port unnecessarily.
RefPtr<const OverscrollHandoffChain> overscrollHandoffChain =
CurrentPanGestureBlock()->GetOverscrollHandoffChain();
if (!overscrollHandoffChain->CanScrollInDirection(this, Layer::HORIZONTAL)) {
mX.SetVelocity(0);
}
if (!overscrollHandoffChain->CanScrollInDirection(this, Layer::VERTICAL)) {
mY.SetVelocity(0);
}
SetState(NOTHING);
RequestContentRepaint();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment