]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Diagram element calculateScaleRecip should never return 0 23/3823/3
authorjsimomaa <jani.simomaa@gmail.com>
Fri, 31 Jan 2020 09:59:32 +0000 (11:59 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 31 Jan 2020 13:41:10 +0000 (13:41 +0000)
gitlab #78

Change-Id: Ie8a71822f7b0a8d2d8a0d9720a825fc8a59cf51f

org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkNodeUtils.java

index 09224291113365b76b67a5297767b5584d01f820..182176d2706e41f67120567e035e9323ed90b435 100644 (file)
@@ -49,6 +49,8 @@ public class DistrictNetworkNodeUtils {
 
     public static double calculateScaleRecip(AffineTransform tr) {
         int zoomLevel = MapScalingTransform.zoomLevel(tr);
+        if (zoomLevel == 0)
+            zoomLevel = 1;
         return 1.0 / (getScale(tr) * Math.sqrt(zoomLevel));
     }