mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Bug 1175564 - don't lock y-axis if pan displacement is 0. r=kats
This commit is contained in:
parent
33c0d1c104
commit
642c1ce6d5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user