mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-12 19:58:25 +00:00
miterlimit is FIXED8 (float)
SVG import - closing rectangle, stroke gradients
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class LineStyle {
|
||||
|
||||
public boolean noClose;
|
||||
|
||||
public int miterLimitFactor;
|
||||
public float miterLimitFactor;
|
||||
|
||||
public boolean hasFillFlag;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user