From: jsimomaa Date: Tue, 23 Apr 2019 12:27:52 +0000 (+0300) Subject: Prevent scaling of edges as well when zoom level > 15 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F2863%2F2;p=simantics%2Fdistrict.git Prevent scaling of edges as well when zoom level > 15 gitlab #35 APROS-15329 Change-Id: Ia3dd90a316d52209015d1bc1c61b83b11932c32d --- 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 c9e4a00e..0d300d05 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 @@ -39,20 +39,13 @@ public class DistrictNetworkNodeUtils { public static double calculateScaleRecip(AffineTransform tr) { int zoomLevel = MapScalingTransform.zoomLevel(tr); - double t; - if (zoomLevel > 15) { - int d = zoomLevel - 15; // stop zooming vertices when zoom level > 15 - t = 1.0 / d / (getScale(tr) * Math.sqrt(zoomLevel)); - } else { - t = 1.0 / (getScale(tr) * Math.sqrt(zoomLevel)); - } - return t; + return 1.0 / (getScale(tr) * Math.sqrt(zoomLevel)); } static double getScale(AffineTransform tr) { double scale; scale = GeometryUtils.getScale(tr); - scale = Math.max(4096, Math.min(scale, 32768)); + scale = Math.max(4096, scale); //Math.min(scale, 32768)); return scale; } }