From 47b104deefb8d96eeefa188f145814c12a3d93fd Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Tue, 23 Apr 2019 15:27:52 +0300 Subject: [PATCH] Prevent scaling of edges as well when zoom level > 15 gitlab #35 APROS-15329 Change-Id: Ia3dd90a316d52209015d1bc1c61b83b11932c32d --- .../network/ui/nodes/DistrictNetworkNodeUtils.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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; } } -- 2.47.1