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

Commit 136c20b8 authored by Shimeng (Simon) Wang's avatar Shimeng (Simon) Wang
Browse files

Better handle double tap for smooth reflow and zoom.

In case it's the first time to reflow or the page is in zoom overview
mode, let the reflow and zoom happen at the same time to avoid the
need of double tapping twice.

Also fix the viewport width to webview's original width for mobile
site.

issue: 4482888
Change-Id: Ic7c73a9eb3f75fd68322f7f4da14141126e75ad8
parent 0df77e6d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1903,7 +1903,7 @@ public final class WebViewCore {
                width = mViewportWidth;
            } else {
                // For mobile web site.
                width = viewWidth;
                width = mWebView.getViewWidth();
            }
        }
        return width;
+10 −1
Original line number Diff line number Diff line
@@ -634,8 +634,17 @@ class ZoomManager {
        } else {
            newTextWrapScale = mActualScale;
        }
        final boolean firstTimeReflow = !exceedsMinScaleIncrement(mActualScale, mTextWrapScale);
        if (firstTimeReflow || mInZoomOverview) {
            // In case first time reflow or in zoom overview mode, let reflow and zoom
            // happen at the same time.
            mTextWrapScale = newTextWrapScale;
        }
        if (settings.isNarrowColumnLayout()
                && exceedsMinScaleIncrement(mTextWrapScale, newTextWrapScale)) {
                && exceedsMinScaleIncrement(mTextWrapScale, newTextWrapScale)
                && !firstTimeReflow
                && !mInZoomOverview) {
            // Reflow only.
            mTextWrapScale = newTextWrapScale;
            refreshZoomScale(true);
        } else if (!mInZoomOverview && willScaleTriggerZoom(getZoomOverviewScale())) {