mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-28 12:57:10 +00:00
feat: allow turning off the minimum stroke width of 1 pixel
This commit is contained in:
@@ -1233,6 +1233,10 @@ public final class Configuration {
|
||||
@ConfigurationCategory("export")
|
||||
public static ConfigurationItem<Integer> msaaGridForExport = null;
|
||||
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
@ConfigurationCategory("display")
|
||||
public static ConfigurationItem<Boolean> useMinimumStrokeWidth1Px = null;
|
||||
|
||||
private static Map<String, String> configurationDescriptions = new LinkedHashMap<>();
|
||||
private static Map<String, String> configurationTitles = new LinkedHashMap<>();
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.exporters.shape;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.exporters.ImageTagBufferedImage;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
|
||||
@@ -422,10 +423,12 @@ public class BitmapExporter extends ShapeExporterBase {
|
||||
}
|
||||
}
|
||||
|
||||
//always display minimum stroke of 1 pixel, no matter how zoomed it is
|
||||
if (thickness * unzoom / aaScale < 1 * SWF.unitDivisor) {
|
||||
thickness = 1 * SWF.unitDivisor / (unzoom / aaScale);
|
||||
}
|
||||
if (Configuration.useMinimumStrokeWidth1Px.get()) {
|
||||
//display minimum stroke of 1 pixel, no matter how zoomed it is
|
||||
if (thickness * unzoom / aaScale < 1 * SWF.unitDivisor) {
|
||||
thickness = 1 * SWF.unitDivisor / (unzoom / aaScale);
|
||||
}
|
||||
}
|
||||
|
||||
if (joinStyle == BasicStroke.JOIN_MITER) {
|
||||
lineStroke = new ExtendedBasicStroke((float) thickness, capStyle, ExtendedBasicStroke.JOIN_MITER_CLIP, miterLimit);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.exporters.shape;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
|
||||
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
||||
@@ -238,11 +239,13 @@ public class SVGShapeExporter extends DefaultSVGShapeExporter {
|
||||
public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, float miterLimit, boolean noClose) {
|
||||
finalizePath();
|
||||
|
||||
//always display minimum stroke of 1 pixel, no matter how zoomed it is
|
||||
if (thickness * displayZoom * thicknessScale < 1 * SWF.unitDivisor) {
|
||||
path.setAttribute("ffdec:has-small-stroke", "true");
|
||||
path.setAttribute("ffdec:original-stroke-width", Double.toString(thickness * displayZoom / SWF.unitDivisor));
|
||||
thickness = 1 * SWF.unitDivisor / displayZoom / thicknessScale;
|
||||
if (Configuration.useMinimumStrokeWidth1Px.get()) {
|
||||
//display minimum stroke of 1 pixel, no matter how zoomed it is
|
||||
if (thickness * displayZoom * thicknessScale < 1 * SWF.unitDivisor) {
|
||||
path.setAttribute("ffdec:has-small-stroke", "true");
|
||||
path.setAttribute("ffdec:original-stroke-width", Double.toString(thickness * displayZoom / SWF.unitDivisor));
|
||||
thickness = 1 * SWF.unitDivisor / displayZoom / thicknessScale;
|
||||
}
|
||||
}
|
||||
|
||||
thickness *= zoom / SWF.unitDivisor;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.exporters.shape;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
|
||||
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
|
||||
@@ -306,11 +307,11 @@ public class XamlShapeExporter extends ShapeExporterBase {
|
||||
public void lineStyle(double thickness, RGB color, boolean pixelHinting, String scaleMode, int startCaps, int endCaps, int joints, float miterLimit, boolean noClose) {
|
||||
finalizePath();
|
||||
|
||||
//always display minimum stroke of 1 pixel, no matter how zoomed it is
|
||||
if (thickness * displayZoom * thicknessScale < 1 * SWF.unitDivisor) {
|
||||
//path.setAttribute("ffdec:has-small-stroke", "true");
|
||||
//path.setAttribute("ffdec:original-stroke-width", Double.toString(thickness * displayZoom / SWF.unitDivisor));
|
||||
thickness = 1 * SWF.unitDivisor / displayZoom / thicknessScale;
|
||||
if (Configuration.useMinimumStrokeWidth1Px.get()) {
|
||||
//display minimum stroke of 1 pixel, no matter how zoomed it is
|
||||
if (thickness * displayZoom * thicknessScale < 1 * SWF.unitDivisor) {
|
||||
thickness = 1 * SWF.unitDivisor / displayZoom / thicknessScale;
|
||||
}
|
||||
}
|
||||
|
||||
thickness *= zoom / SWF.unitDivisor;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jpexs.decompiler.flash.exporters.shape.aa;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
|
||||
import com.jpexs.decompiler.flash.exporters.shape.BitmapExporter;
|
||||
@@ -412,9 +413,11 @@ public class AntialiasedBitmapExporter extends BitmapExporter {
|
||||
|
||||
thickness *= unzoom / SWF.unitDivisor;
|
||||
|
||||
//always display minimum stroke of 1 pixel, no matter how zoomed it is
|
||||
if (thickness < 1) {
|
||||
thickness = 1;
|
||||
if (Configuration.useMinimumStrokeWidth1Px.get()) {
|
||||
//display minimum stroke of 1 pixel, no matter how zoomed it is
|
||||
if (thickness < 1) {
|
||||
thickness = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (joinStyle == BasicStroke.JOIN_MITER) {
|
||||
|
||||
Reference in New Issue
Block a user