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

Commit 35155c1d authored by Cary Clark's avatar Cary Clark
Browse files

divide mRestoredScale before use

Also add debugging to help find incorrect width bug (see bug)

fixes http://b/issue?id=2218767
parent 5de6389f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2042,9 +2042,16 @@ final class WebViewCore {
                // know the exact scale. If mRestoredScale is non-zero, use it;
                // otherwise just use mTextWrapScale as the initial scale.
                data.mScale = mRestoreState.mViewScale == 0
                        ? (mRestoredScale > 0 ? mRestoredScale
                        ? (mRestoredScale > 0 ? mRestoredScale / 100.0f
                                : mRestoreState.mTextWrapScale)
                        : mRestoreState.mViewScale;
                if (DebugFlags.WEB_VIEW_CORE) {
                    Log.v(LOGTAG, "setupViewport"
                             + " mRestoredScale=" + mRestoredScale
                             + " mViewScale=" + mRestoreState.mViewScale
                             + " mTextWrapScale=" + mRestoreState.mTextWrapScale
                             );
                }
                data.mWidth = Math.round(webViewWidth / data.mScale);
                data.mHeight = mCurrentViewHeight * data.mWidth / viewportWidth;
                data.mTextWrapWidth = Math.round(webViewWidth