X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FSCLScenegraph.java;h=630e41abe6326de3d2fd426a1e94cc012a900e72;hp=55ed12656131c0629595cd7ded70c4f4bd064234;hb=a9513be166b1fd5c369b013fedfdd39f07685a2c;hpb=75dc26dacf421e7027e959643963af1efdf10986 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 55ed12656..630e41abe 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java @@ -821,7 +821,7 @@ public class SCLScenegraph { parentBuilder.append(SELECTION_SECTION, "\n"); parentBuilder.append(MAIN_SECTION, "\n"); - } else if (node instanceof SelectionNode) { + } else if (isSelection0(node)) { SelectionNode n = (SelectionNode)node; SingleElementNode parentSEN = (SingleElementNode)NodeUtil.getNearestParentOfType(node, SingleElementNode.class); @@ -849,6 +849,14 @@ public class SCLScenegraph { parentBuilder2.append(SELECTION_MASK_SECTION,"\n"); } + } else if (node instanceof SelectionNode) { + + Element doc = renderSVGNode(svgGenerator, (IG2DNode)node); + String svg = printSVGDocument(doc); + parentBuilder.append(MAIN_SECTION, ""); + parentBuilder.append(MAIN_SECTION, svg); + parentBuilder.append(MAIN_SECTION, "\n"); + } else if (node instanceof SVGNode) { SVGNode svg = (SVGNode)node; parentBuilder.append(MAIN_SECTION, svg.getSVGText()); @@ -882,6 +890,17 @@ public class SCLScenegraph { } + private boolean isSelection0(IG2DNode node) { + + if(node instanceof SelectionNode) { + SelectionNode sn = (SelectionNode)node; + return sn.getSelectionId() == 0; + } else { + return false; + } + + } + private RenderSVGContext getParentBuilder(IG2DNode node) { INode parentSEN = NodeUtil.getNearestParentOfType(node, SingleElementNode.class);