From 69c9cdf76192fbd4b86f319e12736da071449b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 31 Jan 2026 17:26:36 +0100 Subject: [PATCH] Changed: #2610 Export as SWF - take SWF bounds from the exported item bounds --- CHANGELOG.md | 4 ++++ .../decompiler/flash/exporters/PreviewExporter.java | 12 +++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5b8639f6..9bb8b9a05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. ### Fixed - [#2603] Export Sprite as SWF - sprite frames as timeline frames, without sprite itself +### Changed +- [#2610] Export as SWF - take SWF bounds from the exported item bounds + ## [24.1.2] - 2026-01-31 ### Added - [#2581] Save as SWC through context menu of SWF files (previously only in CLI) @@ -4086,6 +4089,7 @@ Major version of SWF to XML export changed to 2. [alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8 [alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7 [#2603]: https://www.free-decompiler.com/flash/issues/2603 +[#2610]: https://www.free-decompiler.com/flash/issues/2610 [#2581]: https://www.free-decompiler.com/flash/issues/2581 [#2592]: https://www.free-decompiler.com/flash/issues/2592 [#2154]: https://www.free-decompiler.com/flash/issues/2154 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/PreviewExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/PreviewExporter.java index 9a24033a1..af323bba8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/PreviewExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/PreviewExporter.java @@ -317,13 +317,11 @@ public class PreviewExporter { outrect = new RECT(treeItemBounds); } else { if (treeItemBounds != null) { - if (outrect.getWidth() < treeItemBounds.getWidth()) { - outrect.Xmax += treeItemBounds.getWidth() - outrect.getWidth(); - } - - if (outrect.getHeight() < treeItemBounds.getHeight()) { - outrect.Ymax += treeItemBounds.getHeight() - outrect.getHeight(); - } + outrect = new RECT(treeItemBounds); + outrect.Xmax = outrect.getWidth(); + outrect.Xmin = 0; + outrect.Ymax = outrect.getHeight(); + outrect.Ymin = 0; } }