X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fadapter%2FCompositeImage.java;h=d4e20230185f18ae59c94824132ed88b401a772f;hb=617b9475710b80a125597f222f9777224972ce72;hp=b8a5daa2681f7b739fcf42efc9414f918b32f761;hpb=a26ea3b7ab8a03f1c4c738d333ab14c4c8e34ae1;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/CompositeImage.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/CompositeImage.java index b8a5daa26..d4e202301 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/CompositeImage.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/CompositeImage.java @@ -155,8 +155,11 @@ public class CompositeImage implements Image { private G2DParentNode getOrCreateParentNode(G2DParentNode parent) { G2DParentNode node = (G2DParentNode)parent.getNode("composite_image_"+this.hashCode()); if (node == null) { - for (INode n : parent.getNodes()) - n.remove(); + for (INode n : parent.getNodes()) { + // #7663: prevent the code from removing other element graphics from directly under another element + if (!(n instanceof SingleElementNode)) + n.remove(); + } // Removed this grouping node as unnecessary, just use the given parent node node = parent.getOrCreateNode("composite_image_"+this.hashCode(), G2DParentNode.class); }