]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Prevent scaling of edges as well when zoom level > 15
authorjsimomaa <jani.simomaa@gmail.com>
Tue, 23 Apr 2019 12:27:52 +0000 (15:27 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 31 Aug 2019 20:08:36 +0000 (23:08 +0300)
gitlab #35
APROS-15329

Change-Id: Ia3dd90a316d52209015d1bc1c61b83b11932c32d

org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkNodeUtils.java

index c9e4a00e19b3be532b23f2d4641590e953bb9524..0d300d058bb1df991ae6cbca6726d9d4332fcfeb 100644 (file)
@@ -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;
     }
 }