]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Diagram element calculateScaleRecip should never return 0 33/3833/1 release/1.35.2
authorjsimomaa <jani.simomaa@gmail.com>
Fri, 31 Jan 2020 09:59:32 +0000 (11:59 +0200)
committerJani Simomaa <jani.simomaa@semantum.fi>
Sun, 2 Feb 2020 05:03:50 +0000 (05:03 +0000)
gitlab #78

Change-Id: Ie8a71822f7b0a8d2d8a0d9720a825fc8a59cf51f
(cherry picked from commit 6b176202f7acfdbea0d23b4b1d56737cdc41a624)

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));
     }