diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e1d8b6e7..df86887a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ All notable changes to this project will be documented in this file. - Convolution matrix filter display and editing - Generic tag editor - Disallow add before/after or remove on parent field with indices - Calculating fillBits, lineBits on SHAPE structure (storing morphshapes, fonts) +- Generic tag editor - COLORMATRIXFILTER has fixed number of float values ## [19.0.0] - 2023-10-01 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/COLORMATRIXFILTER.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/COLORMATRIXFILTER.java index 6066717e1..6561caa69 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/COLORMATRIXFILTER.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/COLORMATRIXFILTER.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.types.filters; import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter; import com.jpexs.decompiler.flash.types.BasicType; +import com.jpexs.decompiler.flash.types.annotations.SWFArray; import com.jpexs.decompiler.flash.types.annotations.SWFType; import com.jpexs.helpers.SerializableImage; import java.util.ArrayList; @@ -36,7 +37,13 @@ public class COLORMATRIXFILTER extends FILTER { * Color matrix values */ @SWFType(BasicType.FLOAT) - public float[] matrix = new float[20]; + @SWFArray(count = 20) + public float[] matrix = new float[] { + 1,0,0,0,0, + 0,1,0,0,0, + 0,0,1,0,0, + 0,0,0,1,0 + }; /** * Constructor diff --git a/src/com/jpexs/decompiler/flash/gui/GenericTagTreePanel.java b/src/com/jpexs/decompiler/flash/gui/GenericTagTreePanel.java index 252e4ce08..8bc82d6d7 100644 --- a/src/com/jpexs/decompiler/flash/gui/GenericTagTreePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/GenericTagTreePanel.java @@ -539,11 +539,17 @@ public class GenericTagTreePanel extends GenericTagPanel { if (itemStr.isEmpty()) { itemStr = AppStrings.translate("generictag.array.item"); } - + boolean canAdd = true; if (!ReflectionTools.canAddToField(fnode.obj, fnode.fieldSet.get(FIELD_INDEX))) { canAdd = false; } + if (swfArray != null) { + if (swfArray.count() > 0) { + canAdd = false; + } + } + JPopupMenu p = new JPopupMenu(); JMenuItem mi; Class subtype = ReflectionTools.getFieldSubType(fnode.obj, fnode.fieldSet.get(FIELD_INDEX)); @@ -581,7 +587,7 @@ public class GenericTagTreePanel extends GenericTagPanel { if (fnode.index > -1) { p.add(mi); - } + } JMenu mAfter = new JMenu(AppStrings.translate("generictag.array.insertafter").replace("%item%", itemStr)); if (fnode.index > -1) { @@ -668,6 +674,9 @@ public class GenericTagTreePanel extends GenericTagPanel { } } }); + if (!canAdd) { + mi.setEnabled(false); + } p.add(mi); mi = new JMenuItem(AppStrings.translate("generictag.array.insertafter").replace("%item%", itemStr));