From 13d459a896797f6ef9437f4b2b6734b2b9dd677a Mon Sep 17 00:00:00 2001 From: Antti Villberg Date: Tue, 15 Sep 2020 11:26:34 +0300 Subject: [PATCH] ElementUtils.setHidden does not hide element gitlab #604 Change-Id: Ib16bd7baa44a131e75f4ec6d62f59d3b7cef2e70 --- .../g2d/diagram/participant/ElementPainter.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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) { -- 2.47.1