From: Tuukka Lehtonen Date: Tue, 5 Dec 2017 20:32:59 +0000 (+0200) Subject: Potential fix for diagram scene graph screw-up regression X-Git-Tag: v1.31.0~6^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F91%2F1291%2F1;p=simantics%2Fplatform.git Potential fix for diagram scene graph screw-up regression refs #7663 Change-Id: I092889d83fcfd653647e4de38984304461649b3f --- 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); }