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

Commit 86773fbb authored by Grace Kloba's avatar Grace Kloba
Browse files

If overview width is the same as the current width,

don't change the mode when double tap or zoom out.

Fix http://b/issue?id=2240785
parent b0fbb7cc
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -4682,7 +4682,9 @@ public class WebView extends AbsoluteLayout
        switchOutDrawHistory();
        float scale = mActualScale * 0.8f;
        if (scale < (mMinZoomScale + 0.1f)
                && mWebViewCore.getSettings().getUseWideViewPort()) {
                && mWebViewCore.getSettings().getUseWideViewPort()
                && mZoomOverviewWidth > Math.ceil(getViewWidth()
                        * mInvActualScale)) {
            // when zoom out to min scale, switch to overview mode
            doDoubleTap();
            return true;
@@ -4829,9 +4831,15 @@ public class WebView extends AbsoluteLayout
        }
        settings.setDoubleTapToastCount(0);
        if (mInZoomOverview) {
            float newScale = (float) getViewWidth() / mZoomOverviewWidth;
            if (Math.abs(mActualScale - newScale) < 0.01f) {
                // reset mInZoomOverview to false if scale doesn't change
                mInZoomOverview = false;
            } else {
                // Force the titlebar fully reveal in overview mode
                if (mScrollY < getTitleHeight()) mScrollY = 0;
            zoomWithPreview((float) getViewWidth() / mZoomOverviewWidth);
                zoomWithPreview(newScale);
            }
        } else {
            // mLastTouchX and mLastTouchY are the point in the current viewport
            int contentX = viewToContentX((int) mLastTouchX + mScrollX);