]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.g2d/src/org/simantics/g2d/elementclass/RouteGraphConnectionClass.java
Even more fixes to layers
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / elementclass / RouteGraphConnectionClass.java
index bf4577b51e1666378a10b3b6a46e4412b54dab99..8da74b64c621bfb11d693424b255547fd46dabf0 100644 (file)
@@ -35,6 +35,7 @@ import org.simantics.g2d.element.handler.SelectionOutline;
 import org.simantics.g2d.element.handler.impl.ConfigurableEdgeVisuals;
 import org.simantics.g2d.element.handler.impl.ConnectionSelectionOutline;
 import org.simantics.g2d.element.handler.impl.FillColorImpl;
+import org.simantics.g2d.element.handler.impl.SimpleElementLayers;
 import org.simantics.g2d.element.handler.impl.TextImpl;
 import org.simantics.g2d.elementclass.connection.EdgeClass.FixedTransform;
 import org.simantics.scenegraph.g2d.G2DParentNode;
@@ -70,7 +71,7 @@ public class RouteGraphConnectionClass {
                 ConnectionSelectionOutline.INSTANCE,
                 ConnectionHandlerImpl.INSTANCE,
                 ConnectionSceneGraph.INSTANCE,
-                //SimpleElementLayers.INSTANCE,
+                SimpleElementLayers.INSTANCE,
 
                 // Exists only loading connection visuals through ConnectionVisualsLoader
                 ConfigurableEdgeVisuals.DEFAULT,
@@ -198,11 +199,11 @@ public class RouteGraphConnectionClass {
 
         @Override
         public Rectangle2D getBounds(IElement e, Rectangle2D size) {
-            RouteGraph rg = getRouteGraph(e);
-            if (rg != null) {
+            RouteGraphNode rgn = e.getHint(KEY_RG_NODE);
+            if (rgn != null) {
                 if (size == null)
                     size = new Rectangle2D.Double();
-                rg.getBounds(size);
+                size.setRect(rgn.getBoundsInLocal());
             }
             return size;
         }