]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ui/src/org/simantics/district/network/ui/adapters/DistrictNetworkVertexElement.java
Add edge geometry for detailed rendering in closer zoom levels
[simantics/district.git] / org.simantics.district.network.ui / src / org / simantics / district / network / ui / adapters / DistrictNetworkVertexElement.java
index b3e7fda3b822401b2d525d51ef7f0c1c0bb70e38..d873835c878bc14916d977153dad4379d09b05aa 100644 (file)
@@ -100,8 +100,12 @@ public class DistrictNetworkVertexElement {
             double counterExpansion = 0.001;
             double x = boundsInLocal.getX() + counterExpansion;
             double y = boundsInLocal.getY() + counterExpansion;
-            double scaledWidth = boundsInLocal.getWidth() / canvasTransform.getScaleX() / 10000.0;
-            double scaledHeight = boundsInLocal.getHeight() / canvasTransform.getScaleY() / 10000.0;
+            double scaledWidth = boundsInLocal.getWidth();
+            double scaledHeight = boundsInLocal.getHeight();
+            if (canvasTransform != null) {
+                scaledWidth = boundsInLocal.getWidth() / canvasTransform.getScaleX() / 10000.0;
+                scaledHeight= boundsInLocal.getHeight() / canvasTransform.getScaleY() / 10000.0;
+            }
             double width = scaledWidth - 2*counterExpansion;
             double height = scaledHeight - 2*counterExpansion;
             size.setFrame(x, y, width, height);