X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FSCLScenegraph.java;h=7545106580b7ea0fa3eebeef97605f7e87605687;hb=refs%2Fchanges%2F63%2F1863%2F1;hp=1e80b832d70aa15fbc2752772792e8202175a08d;hpb=eae2657463e387cb764e7e5780d5c56f5311c0af;p=simantics%2Fplatform.git
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 1e80b832d..754510658 100644
--- a/bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java
+++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java
@@ -378,12 +378,14 @@ public class SCLScenegraph {
public static final String svgNS = "http://www.w3.org/2000/svg";
- public Generator(SVGGeneratorContext ctx, boolean joku) {
- super(ctx, joku);
+ public Generator(SVGGeneratorContext ctx, boolean textAsShapes) {
+ super(ctx, textAsShapes);
}
public Generator(Document document) {
super(document);
+ // prevent batik comment in each g-element
+ getGeneratorContext().setComment(null);
}
@Override
@@ -623,6 +625,7 @@ public class SCLScenegraph {
RenderSVGContext result = new RenderSVGContext();
+ double[] matrix = new double[6];
try {
Selection selection = ctx.getAtMostOneItemOfClass(Selection.class);
@@ -649,10 +652,15 @@ public class SCLScenegraph {
double scale = width < 0 || height < 0 ? 1.0 : Math.min((width - 2*offset) / content.getWidth(), (height - 2*offset) / content.getHeight());
- svgGenerator.translate(offset, offset);
- svgGenerator.scale(scale, scale);
+ AffineTransform tr = new AffineTransform();
+ tr.translate(offset, offset);
+ tr.scale(scale, scale);
+ tr.translate(-content.getX(), -content.getY());
+ tr.getMatrix(matrix);
+ //svgGenerator.translate(offset, offset);
+ //svgGenerator.scale(scale, scale);
// translate svgGenerator to the x and y coordinates of current content
- svgGenerator.translate(-content.getX(), -content.getY());
+ //svgGenerator.translate(-content.getX(), -content.getY());
svgGenerator.setSVGCanvasSize(new Dimension((int)Math.ceil(scale * content.getWidth()) + 2*offset, (int)Math.ceil(scale * content.getHeight()) + 2*offset));
//svgGenerator.setClip(content);
@@ -681,9 +689,11 @@ public class SCLScenegraph {
StringBuilder res = new StringBuilder();
res.append("");
// System.err.println(" == FINAL RESULT == ");
@@ -808,11 +818,7 @@ public class SCLScenegraph {
parentBuilder2.append(SELECTION_SECTION, "\n");
parentBuilder2.append(SELECTION_SECTION, svg);
parentBuilder2.append(SELECTION_SECTION, "\n");
- AffineTransform transform = svgGenerator.getTransform();
- double[] matrix = new double[6];
- transform.getMatrix(matrix);
- String matrixString = String.format("matrix(%f,%f,%f,%f,%f,%f)", matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
- parentBuilder2.append(SELECTION_MASK_SECTION, "\n");
+ parentBuilder2.append(SELECTION_MASK_SECTION, "\n");
Rectangle2D rect = n.getRect();
// NaN
if(rect.getHeight() == rect.getHeight() && rect.getWidth() == rect.getWidth()) {