]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ui/src/org/simantics/district/network/ui/adapters/DistrictNetworkVertexElement.java
Add refresh to context menu in district network breakdown view
[simantics/district.git] / org.simantics.district.network.ui / src / org / simantics / district / network / ui / adapters / DistrictNetworkVertexElement.java
index d873835c878bc14916d977153dad4379d09b05aa..a989c56117644025e9b883620f1af29acf57ff5e 100644 (file)
@@ -22,7 +22,6 @@ import org.simantics.g2d.element.handler.impl.SimpleElementLayers;
 import org.simantics.scenegraph.INode;
 import org.simantics.scenegraph.g2d.G2DParentNode;
 import org.simantics.scenegraph.g2d.nodes.SVGNode;
-import org.simantics.scenegraph.utils.GeometryUtils;
 import org.simantics.utils.datastructures.hints.IHintContext.Key;
 import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;
 
@@ -97,17 +96,16 @@ public class DistrictNetworkVertexElement {
             ICanvasContext ctx = DiagramNodeUtil.getCanvasContext(node);
             AffineTransform canvasTransform = ctx.getHintStack().getHint(Hints.KEY_CANVAS_TRANSFORM);
             // for some reason PickContextImpl expands the rectangle by 0.001 (too much) - let's counter it
-            double counterExpansion = 0.001;
-            double x = boundsInLocal.getX() + counterExpansion;
-            double y = boundsInLocal.getY() + counterExpansion;
+            double x = boundsInLocal.getX();
+            double y = boundsInLocal.getY();
             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;
+                scaledWidth = boundsInLocal.getWidth() / canvasTransform.getScaleX();
+                scaledHeight= boundsInLocal.getHeight() / canvasTransform.getScaleY();
             }
-            double width = scaledWidth - 2*counterExpansion;
-            double height = scaledHeight - 2*counterExpansion;
+            double width = scaledWidth;
+            double height = scaledHeight;
             size.setFrame(x, y, width, height);
             
             return size;