Removed #1935, #1913 Retaining shape exact position(bounds) in SVG export/import

This commit is contained in:
Jindra Petřík
2023-01-10 20:08:55 +01:00
parent 45eb66361c
commit 545d75d389
2 changed files with 7 additions and 4 deletions

View File

@@ -96,8 +96,8 @@ public class SVGExporter {
Element svgRoot = _svg.getDocumentElement();
svgRoot.setAttribute("xmlns:xlink", xlinkNamespace);
if (bounds != null) {
svgRoot.setAttribute("width", (bounds.xMax / SWF.unitDivisor) + "px");
svgRoot.setAttribute("height", (bounds.yMax / SWF.unitDivisor) + "px");
svgRoot.setAttribute("width", (bounds.getWidth() / SWF.unitDivisor) + "px");
svgRoot.setAttribute("height", (bounds.getHeight() / SWF.unitDivisor) + "px");
createDefGroup(bounds, null, zoom);
}
} catch (ParserConfigurationException ex) {
@@ -131,7 +131,7 @@ public class SVGExporter {
public final void createDefGroup(ExportRectangle bounds, String id, double zoom) {
Element g = _svg.createElement("g");
if (bounds != null) {
Matrix mat = new Matrix(); //Matrix.getTranslateInstance(-bounds.xMin, -bounds.yMin);
Matrix mat = Matrix.getTranslateInstance(-bounds.xMin, -bounds.yMin);
mat.scale(zoom);
g.setAttribute("transform", mat.getSvgTransformationString(SWF.unitDivisor, 1));
}