]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ui/src/org/simantics/district/network/ui/adapters/DistrictNetworkEdgeElement.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 / DistrictNetworkEdgeElement.java
index d47580074a9d5a3ef23855bc78745d44be726d4d..34424739eb9a0764dbab3d7338a183b86994ff29 100644 (file)
@@ -105,7 +105,7 @@ public class DistrictNetworkEdgeElement {
             if (size == null)
                 size = new Rectangle2D.Double();
             if (edge != null)
-                size.setFrame(DistrictNetworkEdgeNode.calculatePath(edge, null).getBounds2D());
+                size.setFrame(DistrictNetworkEdgeNode.calculatePath(edge, null, false).getBounds2D());
             else
                 LOGGER.debug("Element {} does not have edge!", e);
 
@@ -116,7 +116,7 @@ public class DistrictNetworkEdgeElement {
         public Shape getElementShape(IElement e) {
             DistrictNetworkEdge edge = e.getHint(KEY_DN_EDGE);
             if (edge != null) {
-                return DistrictNetworkEdgeNode.calculatePath(edge, null);
+                return DistrictNetworkEdgeNode.calculatePath(edge, null, false);
             } else {
                 return getBounds(e, null);
             }
@@ -163,7 +163,7 @@ public class DistrictNetworkEdgeElement {
         }
 
         private boolean pickIntersectingObjects(DistrictNetworkEdge edge, Rectangle2D bounds) {
-            double tolerance = (bounds.getHeight() + bounds.getHeight()) * 0.25 / MapScalingTransform.getScaleX();
+            double tolerance = (bounds.getHeight() + bounds.getHeight()) * 1 / MapScalingTransform.getScaleX();
             Line2D line = new Line2D.Double(edge.getStartPoint(), edge.getEndPoint());
             double sx = bounds.getCenterX() / MapScalingTransform.getScaleX();
             double sy = bounds.getCenterY() / MapScalingTransform.getScaleY();