]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
ElementUtils.setHidden does not hide element
authorAntti Villberg <antti.villberg@semantum.fi>
Tue, 15 Sep 2020 08:26:34 +0000 (11:26 +0300)
committerAntti Villberg <antti.villberg@semantum.fi>
Tue, 15 Sep 2020 08:26:34 +0000 (11:26 +0300)
gitlab #604

Change-Id: Ib16bd7baa44a131e75f4ec6d62f59d3b7cef2e70

bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ElementPainter.java

index ade56085277fae02f3e5c967c6e3e81b062076a4..4f3b30f37da3f823acc8bc7b46e4763169b6cce3 100644 (file)
@@ -759,16 +759,21 @@ public class ElementPainter extends AbstractDiagramParticipant implements Compos
             if (holder == null && parent == null)
                 return null;
 
-            if (ElementUtils.isHidden(e))
-                return null;
-
-
             // Update the node scene graph through SceneGraph handlers.
             List<SceneGraph> nodeHandlers = e.getElementClass().getItemsByClass(SceneGraph.class);
             Collection<SceneGraph> decorators = e.getHint(ElementHints.KEY_DECORATORS);
             if (nodeHandlers.isEmpty() && (decorators == null || decorators.isEmpty()))
                 return null;
 
+            if (ElementUtils.isHidden(e)) {
+                if(holder != null)
+                    holder.removeNode("decorators");
+                for (SceneGraph n : nodeHandlers) {
+                    n.cleanup(e);
+                }
+                return null;
+            }
+
             Composite composite = e.getHint(ElementHints.KEY_COMPOSITE);
 
             if (holder == null) {