Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7db87f0 authored by Adam Powell's avatar Adam Powell Committed by Android Git Automerger
Browse files

am 87584f51: Merge "Fix bug 4083825 - Gesture zoom locked along content edges...

am 87584f51: Merge "Fix bug 4083825 - Gesture zoom locked along content edges under some circumstances" into honeycomb-mr1

* commit '87584f51':
  Fix bug 4083825 - Gesture zoom locked along content edges under some circumstances
parents dd264f21 87584f51
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -777,12 +777,15 @@ class ZoomManager {
    }

    private class ScaleDetectorListener implements ScaleGestureDetector.OnScaleGestureListener {
        private float mAccumulatedSpan;

        public boolean onScaleBegin(ScaleGestureDetector detector) {
            mInitialZoomOverview = false;
            dismissZoomPicker();
            mFocusMovementQueue.clear();
            mWebView.mViewManager.startZoom();
            mWebView.onPinchToZoomAnimationStart();
            mAccumulatedSpan = 0;
            return true;
        }

@@ -797,8 +800,15 @@ class ZoomManager {
                    FloatMath.sqrt((mFocusX - prevFocusX) * (mFocusX - prevFocusX)
                                   + (mFocusY - prevFocusY) * (mFocusY - prevFocusY));
            mFocusMovementQueue.add(focusDelta);
            float deltaSpan = Math.abs(detector.getCurrentSpan() - detector.getPreviousSpan());
            return mFocusMovementQueue.getSum() > deltaSpan;
            float deltaSpan = detector.getCurrentSpan() - detector.getPreviousSpan() +
                    mAccumulatedSpan;
            final boolean result = mFocusMovementQueue.getSum() > Math.abs(deltaSpan);
            if (result) {
                mAccumulatedSpan += deltaSpan;
            } else {
                mAccumulatedSpan = 0;
            }
            return result;
        }

        public boolean handleScale(ScaleGestureDetector detector) {