]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/RouteLine.java
Fixed two problems in connecting picking
[simantics/platform.git] / bundles / org.simantics.diagram.connection / src / org / simantics / diagram / connection / RouteLine.java
index 8a73ead7aec28b406bf3acd0a5ec9786d17f61ec..91a53d85429fa0ac5a2cb0492deb53ea8573ac10 100644 (file)
@@ -97,10 +97,10 @@ public class RouteLine implements RouteNode, Serializable {
     public boolean isNear(double x2, double y2, double tolerance) {
         return isHorizontal 
                 ? Math.abs(y2-position) <= tolerance 
-                    && points.get(0).x <= x2 - tolerance
+                    && points.get(0).x - tolerance <= x2
                     && x2 <= points.get(points.size()-1).x + tolerance
                 : Math.abs(x2-position) <= tolerance 
-                    && points.get(0).y <= y2 - tolerance
+                    && points.get(0).y - tolerance <= y2
                     && y2 <= points.get(points.size()-1).y + tolerance;
     }