summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit/ZoomManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/webkit/ZoomManager.java')
-rw-r--r--core/java/android/webkit/ZoomManager.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java
index 80a6782..1d864e5 100644
--- a/core/java/android/webkit/ZoomManager.java
+++ b/core/java/android/webkit/ZoomManager.java
@@ -287,6 +287,7 @@ class ZoomManager {
if (!exceedsMinScaleIncrement(mMinZoomScale, mMaxZoomScale)) {
mMaxZoomScale = mMinZoomScale;
}
+ sanitizeMinMaxScales();
}
public final float getScale() {
@@ -909,6 +910,14 @@ class ZoomManager {
}
}
+ private void sanitizeMinMaxScales() {
+ if (mMinZoomScale > mMaxZoomScale) {
+ Log.w(LOGTAG, "mMinZoom > mMaxZoom!!! " + mMinZoomScale + " > " + mMaxZoomScale,
+ new Exception());
+ mMaxZoomScale = mMinZoomScale;
+ }
+ }
+
public void onSizeChanged(int w, int h, int ow, int oh) {
// reset zoom and anchor to the top left corner of the screen
// unless we are already zooming
@@ -933,6 +942,7 @@ class ZoomManager {
if (mInitialScale > 0 && mInitialScale < mMinZoomScale) {
mMinZoomScale = mInitialScale;
}
+ sanitizeMinMaxScales();
}
dismissZoomPicker();
@@ -1004,6 +1014,7 @@ class ZoomManager {
} else {
mMaxZoomScale = viewState.mMaxScale;
}
+ sanitizeMinMaxScales();
}
/**
@@ -1033,6 +1044,7 @@ class ZoomManager {
if (!mMinZoomScaleFixed || settings.getUseWideViewPort()) {
mMinZoomScale = newZoomOverviewScale;
mMaxZoomScale = Math.max(mMaxZoomScale, mMinZoomScale);
+ sanitizeMinMaxScales();
}
// fit the content width to the current view for the first new picture
// after first layout.
@@ -1113,6 +1125,7 @@ class ZoomManager {
mMinZoomScale = (mInitialScale > 0) ?
Math.min(mInitialScale, overviewScale) : overviewScale;
mMaxZoomScale = Math.max(mMaxZoomScale, mMinZoomScale);
+ sanitizeMinMaxScales();
}
if (!mWebView.drawHistory()) {