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

Commit 7c6aaf06 authored by Shimeng (Simon) Wang's avatar Shimeng (Simon) Wang
Browse files

Fit to screen for the first new picture with enough different width.

This is to fix cases where the content width is keep changing due to
animation, such as 2011 google io site.

issue: 3451476
Change-Id: I8b1ba27a34e37a18116131ecc60391975ef75788
parent 5fd8dd01
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -864,12 +864,15 @@ class ZoomManager {
        if (!mMinZoomScaleFixed) {
            mMinZoomScale = newZoomOverviewScale;
        }
        // fit the content width to the current view. Ignore the rounding error case.
        if (!mWebView.drawHistory() && (mInitialZoomOverview || (mInZoomOverview
                && Math.abs((viewWidth * mInvActualScale) - mZoomOverviewWidth) > 1))) {
        // fit the content width to the current view for the first new picture
        // after first layout.
        boolean scaleHasDiff = exceedsMinScaleIncrement(newZoomOverviewScale, mActualScale);
        if (!mWebView.drawHistory() && mInitialZoomOverview && scaleHasDiff) {
            mInitialZoomOverview = false;
            setZoomScale(newZoomOverviewScale, !willScaleTriggerZoom(mTextWrapScale) &&
                !mWebView.getSettings().getUseFixedViewport());
        } else if (scaleHasDiff) {
            mInZoomOverview = false;
        }
    }