author | Botond Ballo <botond@mozilla.com> |
Fri, 20 Mar 2015 19:21:04 -0400 | |
changeset 235167 | a7e0ef41f518d91f456e6e2ee1a16ee7d1d045da |
parent 235166 | c9d7dacf7727081fb9f6ce7b55f0764283bca09a |
child 235168 | 21695668595dc62c662ea2c84489e5237aa700d9 |
push id | 28467 |
push user | ryanvm@gmail.com |
push date | Tue, 24 Mar 2015 15:35:47 +0000 |
treeherder | mozilla-central@08f09b24606e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | kats |
bugs | 1145787 |
milestone | 39.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -1282,32 +1282,32 @@ nsEventStatus AsyncPanZoomController::On mLastZoomFocus = aEvent.mLocalFocusPoint - mFrameMetrics.mCompositionBounds.TopLeft(); return nsEventStatus_eConsumeNoDefault; } nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) { APZC_LOG("%p got a scale in state %d\n", this, mState); + if (HasReadyTouchBlock() && !CurrentTouchBlock()->TouchActionAllowsPinchZoom()) { + return nsEventStatus_eIgnore; + } + + if (mState != PINCHING) { + 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()); - if (HasReadyTouchBlock() && !CurrentTouchBlock()->TouchActionAllowsPinchZoom()) { - return nsEventStatus_eIgnore; - } - - if (mState != PINCHING) { - return nsEventStatus_eConsumeNoDefault; - } - 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. return nsEventStatus_eConsumeNoDefault; } float spanRatio = aEvent.mCurrentSpan / aEvent.mPreviousSpan;