]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixes to SVG generation 58/858/1
authorAntti Villberg <antti.villberg@semantum.fi>
Wed, 16 Aug 2017 10:22:10 +0000 (13:22 +0300)
committerAntti Villberg <antti.villberg@semantum.fi>
Wed, 16 Aug 2017 10:22:10 +0000 (13:22 +0300)
refs #7421

Change-Id: Ife3918d5a06a3394494f61c6230ef33ca5fb7302

bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java

index 3e81b1c5cc620b81f23fa8f1ce0fa40fee67db81..dd09f9ebf6ced3a93018fe3ecafb8f141dbdd067 100644 (file)
@@ -636,15 +636,16 @@ public class SCLScenegraph {
                        if(!Double.isFinite(trX)) trX = 0;
                        if(!Double.isFinite(trY)) trY = 0;
                        
-                       result.append(MAIN_SECTION, "<g transform=\"translate(");
-                       result.append(MAIN_SECTION, "" + trX);
-                       result.append(MAIN_SECTION, ", ");
-                       result.append(MAIN_SECTION, "" + trY);
-                       result.append(MAIN_SECTION, ")\">");
-
+                       result.append(MAIN_SECTION, "<g class=\"symbols\">");
                        result.append(SELECTION_SECTION, "<g class=\"selections\">");
-                       
                        result.append(SELECTION_MASK_SECTION, "<g class=\"selectionMasks\">");
+
+                       result.append(ALL_SECTIONS, "<g transform=\"translate(");
+                       result.append(ALL_SECTIONS, "" + trX);
+                       result.append(ALL_SECTIONS, ", ");
+                       result.append(ALL_SECTIONS, "" + trY);
+                       result.append(ALL_SECTIONS, ")\">");
+
                        
                        KeyVisitor keyVisitor = new KeyVisitor();
                        sg.accept(keyVisitor);
@@ -662,9 +663,7 @@ public class SCLScenegraph {
                }
 
 
-               result.append(SELECTION_SECTION, "</g>");
-               result.append(SELECTION_MASK_SECTION, "</g>");
-               result.append(MAIN_SECTION, "</g>");
+               result.append(ALL_SECTIONS, "</g></g>");
 
                StringBuilder res = new StringBuilder();
                res.append("<svg width=\"100%\" height=\"100%\" stroke=\"black\">");