From a91874d1f980f20e874b2d12548fb65334efdfb2 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Mon, 24 Aug 2009 14:08:43 -0400 Subject: [PATCH] don't center zoom on size change if zoom is in progress The onSizeChange code is called when the device is rotated and when the title bar is hidden. In the latter case, it is in response to the zooming transition from overview mode to reading mode, and the zoom center should not be recomputed. http://b/issue?id=2060720 --- core/java/android/webkit/WebView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index f49aab1309ca9..3c93fb0b5ecee 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3674,8 +3674,10 @@ public class WebView extends AbsoluteLayout protected void onSizeChanged(int w, int h, int ow, int oh) { super.onSizeChanged(w, h, ow, oh); // Center zooming to the center of the screen. - mZoomCenterX = getViewWidth() * .5f; - mZoomCenterY = getViewHeight() * .5f; + if (mZoomScale == 0) { // unless we're already zooming + mZoomCenterX = getViewWidth() * .5f; + mZoomCenterY = getViewHeight() * .5f; + } // update mMinZoomScale if the minimum zoom scale is not fixed if (!mMinZoomScaleFixed) {