diff --git a/CHANGELOG.md b/CHANGELOG.md index fb29d3ffc..6045c1163 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. - [#2428] Charset setting on FLA export in format MX and below - [#2428] Default charset for SWFS v5 and lower is WINDOWS-1252 - [#2418] AS3 - initialization of class static vars in script initializer (Haxe) +- [#2397] DefineScalingGrid - improper scaling on negative Xmin, Ymin ## [22.0.2] - 2025-01-17 ### Added @@ -3709,6 +3710,7 @@ Major version of SWF to XML export changed to 2. [#2430]: https://www.free-decompiler.com/flash/issues/2430 [#2428]: https://www.free-decompiler.com/flash/issues/2428 [#2418]: https://www.free-decompiler.com/flash/issues/2418 +[#2397]: https://www.free-decompiler.com/flash/issues/2397 [#2375]: https://www.free-decompiler.com/flash/issues/2375 [#2374]: https://www.free-decompiler.com/flash/issues/2374 [#2389]: https://www.free-decompiler.com/flash/issues/2389 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java index 2ab815420..adee31637 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java @@ -189,10 +189,20 @@ public class DefineScalingGridTag extends Tag implements CharacterIdTag { public static void getSlices(ExportRectangle targetBounds, ExportRectangle boundsRect, ExportRectangle scalingGrid, ExportRectangle[] sourceRect, ExportRectangle[] targetRect, Matrix[] transforms) { double[] src_x = new double[]{boundsRect.xMin, scalingGrid.xMin, scalingGrid.xMax, boundsRect.xMax}; - double[] dst_x = new double[]{targetBounds.xMin, targetBounds.xMin + scalingGrid.xMin, targetBounds.xMax - (boundsRect.xMax - scalingGrid.xMax), targetBounds.xMax}; + double[] dst_x = new double[]{ + targetBounds.xMin, + targetBounds.xMin + scalingGrid.xMin - boundsRect.xMin, + targetBounds.xMax - (boundsRect.xMax - scalingGrid.xMax), + targetBounds.xMax + }; double[] src_y = new double[]{boundsRect.yMin, scalingGrid.yMin, scalingGrid.yMax, boundsRect.yMax}; - double[] dst_y = new double[]{targetBounds.yMin, targetBounds.yMin + scalingGrid.yMin, targetBounds.yMax - (boundsRect.yMax - scalingGrid.yMax), targetBounds.yMax}; + double[] dst_y = new double[]{ + targetBounds.yMin, + targetBounds.yMin + scalingGrid.yMin - boundsRect.yMin, + targetBounds.yMax - (boundsRect.yMax - scalingGrid.yMax), + targetBounds.yMax + }; int pos = 0; for (int sy = 0; sy < 3; sy++) {