mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-13 05:10:32 +00:00
allow to configure what object types to export in exportdialog
This commit is contained in:
@@ -226,7 +226,7 @@ public class Configuration {
|
||||
@ConfigurationCategory("script")
|
||||
public static final ConfigurationItem<String> registerNameFormat = null;
|
||||
|
||||
@ConfigurationDefaultInt(10)
|
||||
@ConfigurationDefaultInt(15)
|
||||
public static final ConfigurationItem<Integer> maxRecentFileCount = null;
|
||||
|
||||
public static final ConfigurationItem<String> recentFiles = null;
|
||||
|
||||
@@ -35,7 +35,7 @@ public abstract class DefaultSVGShapeExporter extends ShapeExporterBase {
|
||||
|
||||
protected String currentDrawCommand = "";
|
||||
|
||||
protected String pathData;
|
||||
protected StringBuilder pathData;
|
||||
|
||||
protected double zoom;
|
||||
|
||||
@@ -101,35 +101,37 @@ public abstract class DefaultSVGShapeExporter extends ShapeExporterBase {
|
||||
@Override
|
||||
public void moveTo(double x, double y) {
|
||||
currentDrawCommand = "";
|
||||
pathData += "M"
|
||||
+ roundPixels20(x * zoom / SWF.unitDivisor) + " "
|
||||
+ roundPixels20(y * zoom / SWF.unitDivisor) + " ";
|
||||
pathData.append("M")
|
||||
.append(roundPixels20(x * zoom / SWF.unitDivisor)).append(" ")
|
||||
.append(roundPixels20(y * zoom / SWF.unitDivisor)).append(" ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lineTo(double x, double y) {
|
||||
if (!currentDrawCommand.equals(DRAW_COMMAND_L)) {
|
||||
currentDrawCommand = DRAW_COMMAND_L;
|
||||
pathData += "L";
|
||||
pathData.append("L");
|
||||
}
|
||||
pathData += roundPixels20(x * zoom / SWF.unitDivisor) + " "
|
||||
+ roundPixels20(y * zoom / SWF.unitDivisor) + " ";
|
||||
|
||||
pathData.append(roundPixels20(x * zoom / SWF.unitDivisor)).append(" ")
|
||||
.append(roundPixels20(y * zoom / SWF.unitDivisor)).append(" ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void curveTo(double controlX, double controlY, double anchorX, double anchorY) {
|
||||
if (!currentDrawCommand.equals(DRAW_COMMAND_Q)) {
|
||||
currentDrawCommand = DRAW_COMMAND_Q;
|
||||
pathData += "Q";
|
||||
pathData.append("Q");
|
||||
}
|
||||
pathData += roundPixels20(controlX * zoom / SWF.unitDivisor) + " "
|
||||
+ roundPixels20(controlY * zoom / SWF.unitDivisor) + " "
|
||||
+ roundPixels20(anchorX * zoom / SWF.unitDivisor) + " "
|
||||
+ roundPixels20(anchorY * zoom / SWF.unitDivisor) + " ";
|
||||
|
||||
pathData.append(roundPixels20(controlX * zoom / SWF.unitDivisor)).append(" ")
|
||||
.append(roundPixels20(controlY * zoom / SWF.unitDivisor)).append(" ")
|
||||
.append(roundPixels20(anchorX * zoom / SWF.unitDivisor)).append(" ")
|
||||
.append(roundPixels20(anchorY * zoom / SWF.unitDivisor)).append(" ");
|
||||
}
|
||||
|
||||
protected void finalizePath() {
|
||||
pathData = "";
|
||||
pathData = new StringBuilder();
|
||||
currentDrawCommand = "";
|
||||
}
|
||||
|
||||
|
||||
@@ -218,8 +218,8 @@ public class SVGShapeExporter extends DefaultSVGShapeExporter {
|
||||
|
||||
@Override
|
||||
protected void finalizePath() {
|
||||
if (path != null && !"".equals(pathData)) {
|
||||
path.setAttribute("d", pathData.trim());
|
||||
if (path != null && pathData.length() > 0) {
|
||||
path.setAttribute("d", pathData.toString().trim());
|
||||
exporter.addToGroup(path);
|
||||
}
|
||||
path = exporter.createElement("path");
|
||||
|
||||
Reference in New Issue
Block a user