Bug 1175564 - don't lock y-axis if pan displacement is 0. r=kats

This commit is contained in:
Paul Rouget 2015-06-19 08:37:00 +02:00
parent 33c0d1c104
commit 642c1ce6d5

View File

@ -1639,10 +1639,14 @@ nsEventStatus AsyncPanZoomController::OnPanBegin(const PanGestureInput& aEvent)
}
float dx = aEvent.mPanDisplacement.x, dy = aEvent.mPanDisplacement.y;
double angle = atan2(dy, dx); // range [-pi, pi]
angle = fabs(angle); // range [0, pi]
HandlePanning(angle);
if (dx || dy) {
double angle = atan2(dy, dx); // range [-pi, pi]
angle = fabs(angle); // range [0, pi]
HandlePanning(angle);
} else {
SetState(PANNING);
}
return nsEventStatus_eConsumeNoDefault;
}