Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b82665e7 authored by Cary Clark's avatar Cary Clark
Browse files

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
parent c28e3a67
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;