From 5ecb5f8a87fa0637ccf675d53164a46afec41ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 6 Mar 2021 17:00:05 +0100 Subject: [PATCH] #1156 FLA Export - 9 slice scaling (DefineScalingGrid) --- CHANGELOG.md | 3 ++- .../com/jpexs/decompiler/flash/xfl/XFLConverter.java | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03e2dae0a..89259e4a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. - [#1645] Scrollbar to recent searches dropdown - [#1639] Clearing search results for current file - [#1371] Go to character id (Ctrl+G in tag tree) +- [#1156] FLA Export - 9 slice scaling (DefineScalingGrid) ### Changed - [#1471] Import script menuitem renamed to Import scripts. @@ -2081,6 +2082,7 @@ All notable changes to this project will be documented in this file. [#1645]: https://www.free-decompiler.com/flash/issues/1645 [#1639]: https://www.free-decompiler.com/flash/issues/1639 [#1371]: https://www.free-decompiler.com/flash/issues/1371 +[#1156]: https://www.free-decompiler.com/flash/issues/1156 [#1471]: https://www.free-decompiler.com/flash/issues/1471 [#1396]: https://www.free-decompiler.com/flash/issues/1396 [#1254]: https://www.free-decompiler.com/flash/issues/1254 @@ -2211,7 +2213,6 @@ All notable changes to this project will be documented in this file. [#1314]: https://www.free-decompiler.com/flash/issues/1314 [#1320]: https://www.free-decompiler.com/flash/issues/1320 [#1323]: https://www.free-decompiler.com/flash/issues/1323 -[#1156]: https://www.free-decompiler.com/flash/issues/1156 [#1171]: https://www.free-decompiler.com/flash/issues/1171 [#1170]: https://www.free-decompiler.com/flash/issues/1170 [#1241]: https://www.free-decompiler.com/flash/issues/1241 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index d62cc53ea..1ab40ffbf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -58,6 +58,7 @@ import com.jpexs.decompiler.flash.tags.DefineButtonSoundTag; import com.jpexs.decompiler.flash.tags.DefineButtonTag; import com.jpexs.decompiler.flash.tags.DefineEditTextTag; import com.jpexs.decompiler.flash.tags.DefineFontNameTag; +import com.jpexs.decompiler.flash.tags.DefineScalingGridTag; import com.jpexs.decompiler.flash.tags.DefineSoundTag; import com.jpexs.decompiler.flash.tags.DefineSpriteTag; import com.jpexs.decompiler.flash.tags.DefineText2Tag; @@ -1503,6 +1504,15 @@ public class XFLConverter { if (linkageExportForAS) { symbolStr.writeAttribute("linkageExportForAS", true); } + + DefineScalingGridTag scalingGrid = symbol.getScalingGridTag(); + if (scalingGrid != null) { + symbolStr.writeAttribute("scaleGridLeft", doubleToString(scalingGrid.splitter.Xmin / SWF.unitDivisor)); + symbolStr.writeAttribute("scaleGridRight", doubleToString(scalingGrid.splitter.Xmax / SWF.unitDivisor)); + symbolStr.writeAttribute("scaleGridTop", doubleToString(scalingGrid.splitter.Ymin / SWF.unitDivisor)); + symbolStr.writeAttribute("scaleGridBottom", doubleToString(scalingGrid.splitter.Ymax / SWF.unitDivisor)); + } + symbolStr.writeStartElement("timeline"); String itemIcon = null; if (symbol instanceof ButtonTag) {