Fix division by zero

This commit is contained in:
Anton Tarasov
2016-12-17 01:01:53 +03:00
parent 05c68faf41
commit cec6f42f4c
@@ -80,7 +80,7 @@ public class JBHiDPIScaledImage extends BufferedImage {
myImage = image;
myUserWidth = width;
myUserHeight = height;
myScale = myImage.getWidth(null) / myUserWidth;
myScale = myUserWidth > 0 ? myImage.getWidth(null) / myUserWidth : 1f;
}
public float getScale() {