From 5b90436d8860b56af851b00eddfb2dcb7ba88dd5 Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Mon, 22 Apr 2019 21:07:46 +0300 Subject: [PATCH] Prevent scaling of vertices in zoom levels > 15 gitlab #35 APROS-15329 Change-Id: I8797d241c3ce59031851e6e74c66c0f4907783b7 --- .../network/ui/nodes/DistrictNetworkNodeUtils.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- 2.47.1