Another attempt to fix ZoomPanView crash

This commit is contained in:
Grishka
2023-10-01 07:16:21 +03:00
parent fc10fbffb0
commit b91840fb95
2 changed files with 5 additions and 3 deletions

View File

@@ -119,8 +119,10 @@ public class ZoomPanView extends FrameLayout implements ScaleGestureDetector.OnS
int width=right-left;
int height=bottom-top;
if(width==0 || height==0)
if(width==0 || height==0 || child.getWidth()==0 || child.getWidth()==0){
matrix.reset();
return;
}
float scale=Math.min(width/(float)child.getWidth(), height/(float)child.getHeight());
minScale=scale;