From: jsimomaa Date: Mon, 22 Apr 2019 18:07:46 +0000 (+0300) Subject: Prevent scaling of vertices in zoom levels > 15 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=71a9c447f5acd8d52b588c2a0311ad339a67cc2f;p=simantics%2Fdistrict.git Prevent scaling of vertices in zoom levels > 15 gitlab #35 APROS-15329 Change-Id: I8797d241c3ce59031851e6e74c66c0f4907783b7 --- 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 21e49b58..c9e4a00e 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,7 +39,13 @@ public class DistrictNetworkNodeUtils { public static double calculateScaleRecip(AffineTransform tr) { int zoomLevel = MapScalingTransform.zoomLevel(tr); - double t = 1.0 / (getScale(tr) * Math.sqrt(zoomLevel)); + 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; }