From 694cdd2bbccb545e74d77befd83f1bdcb79bda5e Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Tue, 5 Dec 2017 22:32:59 +0200 Subject: [PATCH] Potential fix for diagram scene graph screw-up regression refs #7663 Change-Id: I092889d83fcfd653647e4de38984304461649b3f --- .../src/org/simantics/diagram/adapter/CompositeImage.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); } -- 2.47.1