From: Marko Luukkainen Date: Tue, 2 Feb 2021 11:02:03 +0000 (+0200) Subject: Export Connection's children as child SVG elements. X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F42%2F4642%2F1;p=simantics%2Fplatform.git Export Connection's children as child SVG elements. Fix for previous change, connection graphics were exported twice. gitlab #673 Change-Id: I601bca0029725fdef36f221580ced099366880cf --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java index 675c4e525..70461571d 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java @@ -891,8 +891,6 @@ public class SCLScenegraph { svg = printSVGDocument(doc); parentBuilder.append(SELECTION_MASK_SECTION, svg); - parentBuilder.append(SELECTION_MASK_SECTION, "\n"); - parentBuilder.append(SELECTION_SECTION, "\n"); senBuilders.put((ConnectionNode)node, new RenderSVGContext()); @@ -1106,20 +1104,24 @@ public class SCLScenegraph { RenderSVGContext b = senBuilders.get(sen); String content = b.get(MAIN_SECTION); if(content.isEmpty()) { - if(sen.getKey() != null) { - - for(SelectionNode n : NodeUtil.collectNodes(node, SelectionNode.class)) { - n.setIgnore(true); - } - - Element doc = renderSVGNode(svgGenerator, (IG2DNode)node); - String svg = printSVGDocument(doc); - parentBuilder.append(MAIN_SECTION, svg); - } +// Handling connection the same way as SingleElementNode would draw connection twice.. +// if(sen.getKey() != null) { +// +// for(SelectionNode n : NodeUtil.collectNodes(node, SelectionNode.class)) { +// n.setIgnore(true); +// } +// +// Element doc = renderSVGNode(svgGenerator, (IG2DNode)node); +// String svg = printSVGDocument(doc); +// parentBuilder.append(MAIN_SECTION, svg); +// } } else { parentBuilder.append(b); } - parentBuilder.append(MAIN_SECTION, "\n"); + parentBuilder.append(SELECTION_MASK_SECTION, "\n"); + parentBuilder.append(SELECTION_SECTION, "\n"); + parentBuilder.append(MAIN_SECTION, "\n"); + } else if (node instanceof G2DParentNode) { RenderSVGContext parentBuilder = getParentBuilder(node);