@@ -287,6 +287,7 @@ private void setDefaultZoomScale(float defaultScale) {
287287 if (!exceedsMinScaleIncrement (mMinZoomScale , mMaxZoomScale )) {
288288 mMaxZoomScale = mMinZoomScale ;
289289 }
290+ sanitizeMinMaxScales ();
290291 }
291292
292293 public final float getScale () {
@@ -909,6 +910,14 @@ public void onScaleEnd(ScaleGestureDetector detector) {
909910 }
910911 }
911912
913+ private void sanitizeMinMaxScales () {
914+ if (mMinZoomScale > mMaxZoomScale ) {
915+ Log .w (LOGTAG , "mMinZoom > mMaxZoom!!! " + mMinZoomScale + " > " + mMaxZoomScale ,
916+ new Exception ());
917+ mMaxZoomScale = mMinZoomScale ;
918+ }
919+ }
920+
912921 public void onSizeChanged (int w , int h , int ow , int oh ) {
913922 // reset zoom and anchor to the top left corner of the screen
914923 // unless we are already zooming
@@ -933,6 +942,7 @@ public void onSizeChanged(int w, int h, int ow, int oh) {
933942 if (mInitialScale > 0 && mInitialScale < mMinZoomScale ) {
934943 mMinZoomScale = mInitialScale ;
935944 }
945+ sanitizeMinMaxScales ();
936946 }
937947
938948 dismissZoomPicker ();
@@ -1004,6 +1014,7 @@ public void updateZoomRange(WebViewCore.ViewState viewState,
10041014 } else {
10051015 mMaxZoomScale = viewState .mMaxScale ;
10061016 }
1017+ sanitizeMinMaxScales ();
10071018 }
10081019
10091020 /**
@@ -1033,6 +1044,7 @@ public boolean onNewPicture(WebViewCore.DrawData drawData) {
10331044 if (!mMinZoomScaleFixed || settings .getUseWideViewPort ()) {
10341045 mMinZoomScale = newZoomOverviewScale ;
10351046 mMaxZoomScale = Math .max (mMaxZoomScale , mMinZoomScale );
1047+ sanitizeMinMaxScales ();
10361048 }
10371049 // fit the content width to the current view for the first new picture
10381050 // after first layout.
@@ -1113,6 +1125,7 @@ public void onFirstLayout(WebViewCore.DrawData drawData) {
11131125 mMinZoomScale = (mInitialScale > 0 ) ?
11141126 Math .min (mInitialScale , overviewScale ) : overviewScale ;
11151127 mMaxZoomScale = Math .max (mMaxZoomScale , mMinZoomScale );
1128+ sanitizeMinMaxScales ();
11161129 }
11171130
11181131 if (!mWebView .drawHistory ()) {
0 commit comments