From: Antti Villberg Date: Tue, 15 Sep 2020 08:26:34 +0000 (+0300) Subject: ElementUtils.setHidden does not hide element X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=13d459a896797f6ef9437f4b2b6734b2b9dd677a;p=simantics%2Fplatform.git ElementUtils.setHidden does not hide element gitlab #604 Change-Id: Ib16bd7baa44a131e75f4ec6d62f59d3b7cef2e70 --- diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ElementPainter.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ElementPainter.java index ade560852..4f3b30f37 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ElementPainter.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ElementPainter.java @@ -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 nodeHandlers = e.getElementClass().getItemsByClass(SceneGraph.class); Collection 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) {