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

@@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file.
## [Unreleased]
### Removed
- [#1935], [#1913] Retaining shape exact position(bounds) in SVG export/import
## [18.3.1] - 2023-01-09
### Added
@@ -2854,12 +2856,13 @@ All notable changes to this project will be documented in this file.
[alpha 9]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha8...alpha9
[alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8
[alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7
[#1935]: https://www.free-decompiler.com/flash/issues/1935
[#1913]: https://www.free-decompiler.com/flash/issues/1913
[#1931]: https://www.free-decompiler.com/flash/issues/1931
[#1934]: https://www.free-decompiler.com/flash/issues/1934
[#1929]: https://www.free-decompiler.com/flash/issues/1929
[#1932]: https://www.free-decompiler.com/flash/issues/1932
[#1933]: https://www.free-decompiler.com/flash/issues/1933
[#1913]: https://www.free-decompiler.com/flash/issues/1913
[#1905]: https://www.free-decompiler.com/flash/issues/1905
[#1915]: https://www.free-decompiler.com/flash/issues/1915
[#1923]: https://www.free-decompiler.com/flash/issues/1923

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));
}