diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java index 4b6ef7b14..460ffce4b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -2718,7 +2718,7 @@ public class SWFInputStream implements AutoCloseable { ret.noClose = (int) readUB(1, "noClose") == 1; ret.endCapStyle = (int) readUB(2, "endCapStyle"); if (ret.joinStyle == LINESTYLE2.MITER_JOIN) { - ret.miterLimitFactor = readUI16("miterLimitFactor"); + ret.miterLimitFactor = readFIXED8("miterLimitFactor"); } if (!ret.hasFillFlag) { ret.color = readRGBA("color"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java index e51aa2ce2..c91d9e83f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java @@ -1317,7 +1317,7 @@ public class SWFOutputStream extends OutputStream { writeUB(1, value.noClose ? 1 : 0); writeUB(2, value.endCapStyle); if (value.joinStyle == LINESTYLE2.MITER_JOIN) { - writeUI16(value.miterLimitFactor); + writeFIXED8(value.miterLimitFactor); } if (!value.hasFillFlag) { writeRGBA((RGBA) value.color); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/LineStyle.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/LineStyle.java index 98be8cc18..e043519c4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/LineStyle.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/LineStyle.java @@ -46,7 +46,7 @@ public class LineStyle { public boolean noClose; - public int miterLimitFactor; + public float miterLimitFactor; public boolean hasFillFlag; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java index f5666fd5b..e92c1ebea 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java @@ -320,7 +320,7 @@ public class BitmapExporter extends ShapeExporterBase { } @Override - public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, int miterLimit) { + public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, float miterLimit) { finalizePath(); linePaint = null; lineTransform = null; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/CanvasShapeExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/CanvasShapeExporter.java index d14cd18c2..6f63b67bd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/CanvasShapeExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/CanvasShapeExporter.java @@ -279,7 +279,7 @@ public class CanvasShapeExporter extends ShapeExporterBase { } @Override - public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, int miterLimit) { + public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, float miterLimit) { finalizePath(); thickness /= SWF.unitDivisor; strokeData.append("\tvar scaleMode = \"").append(scaleMode).append("\";\r\n"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/DefaultSVGShapeExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/DefaultSVGShapeExporter.java index c04ffbbec..1963259ba 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/DefaultSVGShapeExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/DefaultSVGShapeExporter.java @@ -94,7 +94,7 @@ public abstract class DefaultSVGShapeExporter extends ShapeExporterBase { } @Override - public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, int miterLimit) { + public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, float miterLimit) { finalizePath(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/IShapeExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/IShapeExporter.java index eb6818174..980d4b059 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/IShapeExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/IShapeExporter.java @@ -47,7 +47,7 @@ public interface IShapeExporter { public void endFill(); - public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, int miterLimit); + public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, float miterLimit); public void lineGradientStyle(int type, GRADRECORD[] gradientRecords, Matrix matrix, int spreadMethod, int interpolationMethod, float focalPointRatio); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/PathExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/PathExporter.java index efee57f69..40c74b5db 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/PathExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/PathExporter.java @@ -102,7 +102,7 @@ public class PathExporter extends ShapeExporterBase { } @Override - public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, int miterLimit) { + public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, float miterLimit) { finalizePath(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/SVGShapeExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/SVGShapeExporter.java index cae1dc763..50590f337 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/SVGShapeExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/SVGShapeExporter.java @@ -135,7 +135,7 @@ public class SVGShapeExporter extends DefaultSVGShapeExporter { } @Override - public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, int miterLimit) { + public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, float miterLimit) { finalizePath(); thickness *= zoom / SWF.unitDivisor; path.setAttribute("fill", "none"); @@ -169,8 +169,8 @@ public class SVGShapeExporter extends DefaultSVGShapeExporter { break; default: path.setAttribute("stroke-linejoin", "miter"); - if (miterLimit >= 1 && miterLimit != 4) { - path.setAttribute("stroke-miterlimit", Integer.toString(miterLimit)); + if (miterLimit >= 1 && miterLimit != 4f) { + path.setAttribute("stroke-miterlimit", Double.toString(miterLimit)); } break; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/ShapeExporterBase.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/ShapeExporterBase.java index f8cfd9a9e..2dabff88c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/ShapeExporterBase.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/ShapeExporterBase.java @@ -190,12 +190,10 @@ public abstract class ShapeExporterBase implements IShapeExporter { if (straightEdgeRecord.generalLineFlag) { xPos += straightEdgeRecord.deltaX; yPos += straightEdgeRecord.deltaY; + } else if (straightEdgeRecord.vertLineFlag) { + yPos += straightEdgeRecord.deltaY; } else { - if (straightEdgeRecord.vertLineFlag) { - yPos += straightEdgeRecord.deltaY; - } else { - xPos += straightEdgeRecord.deltaX; - } + xPos += straightEdgeRecord.deltaX; } subPath.add(new StraightEdge(xPosFrom, yPosFrom, xPos, yPos, currentLineStyleIdx, currentFillStyleIdx1)); } else if (shapeRecord instanceof CurvedEdgeRecord) { @@ -347,7 +345,7 @@ public abstract class ShapeExporterBase implements IShapeExporter { int startCapStyle = LINESTYLE2.ROUND_CAP; int endCapStyle = LINESTYLE2.ROUND_CAP; int joinStyle = LINESTYLE2.ROUND_JOIN; - int miterLimitFactor = 3; + float miterLimitFactor = 3f; boolean hasFillFlag = false; autoClose = true; if (lineStyle.isLineStyle2) {