summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2009-10-29 15:34:00 -0400
committerCary Clark <cary@android.com>2009-10-29 15:34:00 -0400
commit35155c1d8b25ae70697550029807a355c66461b2 (patch)
tree4bba3099b83ebaeeaabb17434db78ffa7da3e321
parent5de6389f2252cb6e39918e21f80a08918e0c2c02 (diff)
downloadframeworks_base-35155c1d8b25ae70697550029807a355c66461b2.zip
frameworks_base-35155c1d8b25ae70697550029807a355c66461b2.tar.gz
frameworks_base-35155c1d8b25ae70697550029807a355c66461b2.tar.bz2
divide mRestoredScale before use
Also add debugging to help find incorrect width bug (see bug) fixes http://b/issue?id=2218767
-rw-r--r--core/java/android/webkit/WebViewCore.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index b466591..bfaa353 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -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