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:
@@ -4868,7 +4868,8 @@ public class WebView extends AbsoluteLayout
|
|||||||
mLastScale = restoreState.mTextWrapScale;
|
mLastScale = restoreState.mTextWrapScale;
|
||||||
if (restoreState.mMinScale == 0) {
|
if (restoreState.mMinScale == 0) {
|
||||||
if (restoreState.mMobileSite) {
|
if (restoreState.mMobileSite) {
|
||||||
if (draw.mMinPrefWidth > draw.mViewPoint.x) {
|
if (draw.mMinPrefWidth >
|
||||||
|
Math.max(0, draw.mViewPoint.x)) {
|
||||||
mMinZoomScale = (float) viewWidth
|
mMinZoomScale = (float) viewWidth
|
||||||
/ draw.mMinPrefWidth;
|
/ draw.mMinPrefWidth;
|
||||||
mMinZoomScaleFixed = false;
|
mMinZoomScaleFixed = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user