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

Commit 87584f51 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Fix bug 4083825 - Gesture zoom locked along content edges under some...

Merge "Fix bug 4083825 - Gesture zoom locked along content edges under some circumstances" into honeycomb-mr1
parents 76470914 c37308f1
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) {