зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1145787 - Put a misplaced assertion into its proper place. r=kats
--HG-- extra : source : 04c4a02aece447cc7f6babd104b2c65070ccffdc
This commit is contained in:
Родитель
9bef23d187
Коммит
9d41c408f3
|
@ -1287,14 +1287,6 @@ nsEventStatus AsyncPanZoomController::OnScaleBegin(const PinchGestureInput& aEve
|
|||
nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) {
|
||||
APZC_LOG("%p got a scale in state %d\n", this, mState);
|
||||
|
||||
// Only the root APZC is zoomable, and the root APZC is not allowed to have
|
||||
// different x and y scales. If it did, the calculations in this function
|
||||
// would have to be adjusted (as e.g. it would no longer be valid to take
|
||||
// the minimum or maximum of the ratios of the widths and heights of the
|
||||
// page rect and the composition bounds).
|
||||
MOZ_ASSERT(mFrameMetrics.IsRootScrollable());
|
||||
MOZ_ASSERT(mFrameMetrics.GetZoom().AreScalesSame());
|
||||
|
||||
if (HasReadyTouchBlock() && !CurrentTouchBlock()->TouchActionAllowsPinchZoom()) {
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
@ -1303,6 +1295,14 @@ nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) {
|
|||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
||||
// Only the root APZC is zoomable, and the root APZC is not allowed to have
|
||||
// different x and y scales. If it did, the calculations in this function
|
||||
// would have to be adjusted (as e.g. it would no longer be valid to take
|
||||
// the minimum or maximum of the ratios of the widths and heights of the
|
||||
// page rect and the composition bounds).
|
||||
MOZ_ASSERT(mFrameMetrics.IsRootScrollable());
|
||||
MOZ_ASSERT(mFrameMetrics.GetZoom().AreScalesSame());
|
||||
|
||||
float prevSpan = aEvent.mPreviousSpan;
|
||||
if (fabsf(prevSpan) <= EPSILON || fabsf(aEvent.mCurrentSpan) <= EPSILON) {
|
||||
// We're still handling it; we've just decided to throw this event away.
|
||||
|
|
Загрузка…
Ссылка в новой задаче