From be1dc0699d0a7b0e5100bf12c70cc8ee449fb1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 23 Oct 2022 19:24:22 +0200 Subject: [PATCH] Fixed #1829 Adding extra pixel to the width and height when rendering items (for example to AVI) --- CHANGELOG.md | 4 +++- .../ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba226084e..a724ec788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,9 +13,10 @@ All notable changes to this project will be documented in this file. - [#1834] PlaceObject4 tags appear as Unresolved inside of DefineSprite - [#1839] Sprite frames exported incorrectly and repeating - [#1838] AS3 - Properly handling of long unsigned values, hex values, default uint values etc. -- [#1847] shape viewer and PDF exporter - correct drawing of pure vertical/horizontal shapes (zero width/height) +- [#1847] Shape viewer and PDF exporter - correct drawing of pure vertical/horizontal shapes (zero width/height) - Slow zooming/redrawing on action when SWF has low framerate - Correct debug info label position/content on the top of flash viewer to avoid unwanted initial scroll +- [#1829] Adding extra pixel to the width and height when rendering items (for example to AVI) ### Changed - AS3 integer values are internally (e.g. in the lib) handled as java int type instead of long. @@ -2387,6 +2388,7 @@ All notable changes to this project will be documented in this file. [#1839]: https://www.free-decompiler.com/flash/issues/1839 [#1838]: https://www.free-decompiler.com/flash/issues/1838 [#1847]: https://www.free-decompiler.com/flash/issues/1847 +[#1829]: https://www.free-decompiler.com/flash/issues/1829 [#270]: https://www.free-decompiler.com/flash/issues/270 [#1718]: https://www.free-decompiler.com/flash/issues/1718 [#1801]: https://www.free-decompiler.com/flash/issues/1801 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 5ed786a22..c19f8e370 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -483,7 +483,7 @@ public final class SWF implements SWFContainerItem, Timelined { return null; } - + public void computeDependentCharacters() { Map> dep = new HashMap<>(); for (Tag tag : getTags()) { @@ -552,7 +552,7 @@ public final class SWF implements SWFContainerItem, Timelined { return dependents; } - + public void computeDependentFrames() { Map> dep = new HashMap<>(); for (int i = 0; i < timeline.getFrameCount(); i++) { @@ -1485,7 +1485,7 @@ public final class SWF implements SWFContainerItem, Timelined { } } - public void assignExportNamesToSymbols() { + public void assignExportNamesToSymbols() { HashMap exportNames = new HashMap<>(); for (Tag t : getTags()) { if (t instanceof ExportAssetsTag) { @@ -2948,8 +2948,9 @@ public final class SWF implements SWFContainerItem, Timelined { } RECT rect = displayRect; - SerializableImage image = new SerializableImage((int) (rect.getWidth() * zoom / SWF.unitDivisor) + 1, - (int) (rect.getHeight() * zoom / SWF.unitDivisor) + 1, SerializableImage.TYPE_INT_ARGB_PRE); + SerializableImage image = new SerializableImage( + rect.getWidth() == 0 ? 1 /*FIXME: is this necessary?*/ : (int) (rect.getWidth() * zoom / SWF.unitDivisor), + rect.getHeight() == 0 ? 1 : (int) (rect.getHeight() * zoom / SWF.unitDivisor), SerializableImage.TYPE_INT_ARGB_PRE); if (backGroundColor == null) { image.fillTransparent(); } else {