diff options
| author | Mangesh Ghiware <mghiware@google.com> | 2011-11-01 14:02:05 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-01 14:02:05 -0700 |
| commit | 274133dfef84f93de349fcd34919f4df32279e8a (patch) | |
| tree | 9bdb3f9db093dc8b63494ea1779b471c485c7b9b /core/java | |
| parent | abf7539642a7c3d8d31c1d12d705b54cf155db1a (diff) | |
| parent | e9841bb45d32685cf1371659fbf5ce4a3b88e782 (diff) | |
Merge "Fix setInitialScale() to take display density into account." into ics-mr1
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/webkit/ZoomManager.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java index 2a0b6e5d5059..e829571d531f 100644 --- a/core/java/android/webkit/ZoomManager.java +++ b/core/java/android/webkit/ZoomManager.java @@ -169,11 +169,7 @@ class ZoomManager { /* * The initial scale for the WebView. 0 means default. If initial scale is - * greater than 0 the WebView starts with this value as its initial scale. The - * value is converted from an integer percentage so it is guarenteed to have - * no more than 2 significant digits after the decimal. This restriction - * allows us to convert the scale back to the original percentage by simply - * multiplying the value by 100. + * greater than 0, the WebView starts with this value as its initial scale. */ private float mInitialScale; @@ -313,7 +309,7 @@ class ZoomManager { } public final float getDefaultScale() { - return mInitialScale > 0 ? mInitialScale : mDefaultScale; + return mDefaultScale; } /** @@ -353,9 +349,7 @@ class ZoomManager { } public final void setInitialScaleInPercent(int scaleInPercent) { - mInitialScale = scaleInPercent * 0.01f; - mActualScale = mInitialScale > 0 ? mInitialScale : mDefaultScale; - mInvActualScale = 1 / mActualScale; + mInitialScale = scaleInPercent * mDisplayDensity * 0.01f; } public final float computeScaleWithLimits(float scale) { @@ -1120,7 +1114,6 @@ class ZoomManager { float scale; if (mInitialScale > 0) { scale = mInitialScale; - mTextWrapScale = scale; } else if (viewState.mIsRestored) { scale = (viewState.mViewScale > 0) ? viewState.mViewScale : overviewScale; @@ -1141,7 +1134,7 @@ class ZoomManager { } boolean reflowText = false; if (!viewState.mIsRestored) { - if (settings.getUseFixedViewport() && mInitialScale == 0) { + if (settings.getUseFixedViewport()) { // Override the scale only in case of fixed viewport. scale = Math.max(scale, overviewScale); mTextWrapScale = Math.max(mTextWrapScale, overviewScale); |
