diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 8c6b28309..d7b619bc8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -2064,7 +2064,7 @@ public class SWFInputStream extends InputStream { * @return SHAPERECORD value * @throws IOException */ - public SHAPERECORD readSHAPERECORD(int fillBits, int lineBits, int shapeNum) throws IOException { + private SHAPERECORD readSHAPERECORD(int fillBits, int lineBits, int shapeNum) throws IOException { SHAPERECORD ret; int typeFlag = (int) readUB(1); if (typeFlag == 0) { @@ -2174,7 +2174,7 @@ public class SWFInputStream extends InputStream { * @return SHAPERECORDs array * @throws IOException */ - public List readSHAPERECORDS(int shapeNum, int fillBits, int lineBits) throws IOException { + private List readSHAPERECORDS(int shapeNum, int fillBits, int lineBits) throws IOException { List ret = new ArrayList<>(); SHAPERECORD rec; do { diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java index fd2073b05..5b4ae6826 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java @@ -1250,7 +1250,7 @@ public class SWFOutputStream extends OutputStream { * @param shapeNum 1 in DefineShape, 2 in DefineShape2,... * @throws IOException */ - public void writeSHAPERECORDS(List value, int fillBits, int lineBits, int shapeNum) throws IOException { + private void writeSHAPERECORDS(List value, int fillBits, int lineBits, int shapeNum) throws IOException { for (SHAPERECORD sh : value) { if (sh instanceof CurvedEdgeRecord) { CurvedEdgeRecord cer = (CurvedEdgeRecord) sh; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java index 44b426c40..519b59f79 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; +import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.ShapeTag; @@ -28,6 +29,7 @@ import java.awt.Point; import java.awt.geom.GeneralPath; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -69,6 +71,25 @@ public class DefineShapeTag extends CharacterTag implements BoundedTag, ShapeTag shapes = sis.readSHAPEWITHSTYLE(1); } + /** + * Gets data bytes + * + * @param version SWF version + * @return Bytes of data + */ + @Override + public byte[] getData(int version) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + SWFOutputStream sos = new SWFOutputStream(baos, version); + try { + sos.writeUI16(shapeId); + sos.writeRECT(shapeBounds); + sos.writeSHAPEWITHSTYLE(shapes, 1); + } catch (IOException e) { + } + return baos.toByteArray(); + } + @Override public int getCharacterId() { return shapeId; diff --git a/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/CurvedEdgeRecord.java b/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/CurvedEdgeRecord.java index 132bd9250..c53bfdfea 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/CurvedEdgeRecord.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/CurvedEdgeRecord.java @@ -45,7 +45,6 @@ public class CurvedEdgeRecord extends SHAPERECORD { result = "M " + SWF.twipToPixel(oldX) + " " + SWF.twipToPixel(oldY) + " "; } return result + "Q " + SWF.twipToPixel(oldX + controlDeltaX) + " " + SWF.twipToPixel(oldY + controlDeltaY) + " " + SWF.twipToPixel(oldX + controlDeltaX + anchorDeltaX) + " " + SWF.twipToPixel(oldY + controlDeltaY + anchorDeltaY); - } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/SHAPERECORD.java b/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/SHAPERECORD.java index 7e83182b4..5561cbe2e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/SHAPERECORD.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/SHAPERECORD.java @@ -469,6 +469,8 @@ public abstract class SHAPERECORD implements Cloneable, NeedsCharacters, Seriali f = " fill=\"" + ((shapeNum >= 3) ? fillStyle0.colorA.toHexRGB() : fillStyle0.color.toHexRGB()) + "\""; break; } + } else { + f = " fill=\"none\""; } params += f; if ((!useLineStyle2) && lineStyle != null) { @@ -737,6 +739,7 @@ public abstract class SHAPERECORD implements Cloneable, NeedsCharacters, Seriali } } List subpath; + List edges; Point k2; Point k1;