X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scenegraph%2Fsrc%2Forg%2Fsimantics%2Fscenegraph%2Fg2d%2Fnodes%2FConnectionNode.java;h=9331a1edea5afea8ae5cc5b086d790bb92e02d95;hp=d4543c6d110546c08cf8709f94f3af81d9501810;hb=6c70e409e03187c96b057aa5705d49800c6b8b07;hpb=ff1c29bf73b3e5ea939dc1987540aa0240dc4ae6 diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/ConnectionNode.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/ConnectionNode.java index d4543c6d1..9331a1ede 100644 --- a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/ConnectionNode.java +++ b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/ConnectionNode.java @@ -16,6 +16,7 @@ import java.awt.Composite; import java.awt.Graphics2D; import java.awt.Stroke; import java.awt.geom.Point2D; +import java.awt.geom.Rectangle2D; import org.simantics.diagram.connection.RouteGraph; import org.simantics.scenegraph.INode; @@ -161,5 +162,17 @@ public class ConnectionNode extends SingleElementNode implements InitValueSuppor public void afterRender(Graphics2D g) { g.setRenderingHint(G2DRenderingHints.KEY_END_ELEMENT, "connection"); } - + + @Override + public Rectangle2D getBoundsInLocal() { + // #134: Route graph connections render their own selection. + // ElementPainter will place an empty G2DParentNode + // called "selection" under this ConnectionNode which + // should be ignored in bounds calculations. + // Otherwise this node will not support being inserted + // into a spatial search structure and further selections + // will fail. + return super.getBoundsInLocal(true); + } + }