From ba6728023d9c9a5f13b9fc6e2015527b99b30c41 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Fri, 25 Sep 2009 15:54:08 -0700 Subject: [PATCH] When change from narrow screen to wide screen, we will leave the mMinZoomScale to 1.0 --- core/java/android/webkit/WebView.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 3ce1815a37d05..90985e062cacb 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3587,9 +3587,13 @@ public class WebView extends AbsoluteLayout // update mMinZoomScale if the minimum zoom scale is not fixed if (!mMinZoomScaleFixed) { - mMinZoomScale = (float) getViewWidth() + // when change from narrow screen to wide screen, the new viewWidth + // can be wider than the old content width. We limit the minimum + // scale to 1.0f. The proper minimum scale will be calculated when + // the new picture shows up. + mMinZoomScale = Math.min(1.0f, (float) getViewWidth() / (mDrawHistory ? mHistoryPicture.getWidth() - : mZoomOverviewWidth); + : mZoomOverviewWidth)); } // we always force, in case our height changed, in which case we still