From baf353dee8cd4769fa763e5593d500a597e2295c Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Fri, 31 Jan 2020 11:59:32 +0200 Subject: [PATCH] Diagram element calculateScaleRecip should never return 0 gitlab #78 Change-Id: Ie8a71822f7b0a8d2d8a0d9720a825fc8a59cf51f (cherry picked from commit 6b176202f7acfdbea0d23b4b1d56737cdc41a624) --- .../district/network/ui/nodes/DistrictNetworkNodeUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkNodeUtils.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkNodeUtils.java index 09224291..182176d2 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkNodeUtils.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkNodeUtils.java @@ -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)); } -- 2.47.1