don't allow min scale to go to infinity

When a new picture is received, the min zoom scale is set.
One of the many choices divides by draw.mMinPrefWidth, even
if it is zero. Add a check to require it to be greater than
zero before using it as a ratio component.

fixes http://b/issue?id=2138786
This commit is contained in:
Cary Clark
2009-09-23 12:49:28 -04:00
parent c28e3a670f
commit b82665e78f

View File

@@ -4868,7 +4868,8 @@ public class WebView extends AbsoluteLayout
mLastScale = restoreState.mTextWrapScale;
if (restoreState.mMinScale == 0) {
if (restoreState.mMobileSite) {
if (draw.mMinPrefWidth > draw.mViewPoint.x) {
if (draw.mMinPrefWidth >
Math.max(0, draw.mViewPoint.x)) {
mMinZoomScale = (float) viewWidth
/ draw.mMinPrefWidth;
mMinZoomScaleFixed = false;