mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 08:36:08 +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) {
|
||||
|
||||
@@ -691,3 +691,6 @@ config.description.msaaGridForDisplay = Multi sample Anti-aliasing grid size NxN
|
||||
|
||||
config.name.msaaGridForExport = Multi sample Anti-aliasing Grid (Export)
|
||||
config.description.msaaGridForExport = Multi sample Anti-aliasing grid size NxN for display purposes.
|
||||
|
||||
config.name.useMinimumStrokeWidth1Px = Minimum stroke width of 1 pixel (As in Flash)
|
||||
config.description.useMinimumStrokeWidth1Px = Use 1 pixel as minimal stroke width. Flash renders strokes this way. Turn this off to allow thinner strokes.
|
||||
|
||||
@@ -691,3 +691,6 @@ config.description.msaaGridForDisplay = Velikost m\u0159\u00ed\u017eky v\u00edce
|
||||
|
||||
config.name.msaaGridForExport = M\u0159\u00ed\u017eka v\u00edcen\u00e1sobn\u00e9ho vyhlazov\u00e1n\u00ed (Export)
|
||||
config.description.msaaGridForExport = Velikost m\u0159\u00ed\u017eky v\u00edcen\u00e1sobn\u00e9ho vyhlazov\u00e1n\u00ed NxN pro \u00fa\u010dely zobrazen\u00ed.
|
||||
|
||||
config.name.useMinimumStrokeWidth1Px = Minim\u00e1ln\u00ed \u0161\u00ed\u0159ka tahu 1 pixel (jako ve Flashi)
|
||||
config.description.useMinimumStrokeWidth1Px = Pou\u017e\u00edt 1 pixel jako minim\u00e1ln\u00ed \u0161\u00ed\u0159ku tahu. Flash vykresluje tahy t\u00edmto zp\u016fsobem. Vypn\u011bte pro umo\u017en\u011bn\u00ed ten\u010d\u00edch tah\u016f.
|
||||
|
||||
@@ -620,3 +620,6 @@ config.description.msaaGridForDisplay = Rastergr\u00f6\u00dfe NxN f\u00fcr Multi
|
||||
|
||||
config.name.msaaGridForExport = Multisample-Anti-Aliasing-Raster (Export)
|
||||
config.description.msaaGridForExport = Rastergr\u00f6\u00dfe NxN pro Multisample-Anti-Aliasing pro Anzeigezwecke.
|
||||
|
||||
config.name.useMinimumStrokeWidth1Px = Minimale Strichbreite von 1 Pixel (wie in Flash)
|
||||
config.description.useMinimumStrokeWidth1Px = 1 Pixel als minimale Strichbreite verwenden. Flash rendert Striche auf diese Weise. Deaktivieren, um d\u00fcnnere Striche zu erm\u00f6glichen.
|
||||
|
||||
@@ -691,3 +691,6 @@ config.description.msaaGridForDisplay = Ve\u013ekos\u0165 mrie\u017eky viacn\u00
|
||||
|
||||
config.name.msaaGridForExport = Mrie\u017eka viacn\u00e1sobn\u00e9ho vyhladzovania (Export)
|
||||
config.description.msaaGridForExport = Ve\u013ekos\u0165 mrie\u017eky viacn\u00e1sobn\u00e9ho vyhladzovania NxN na \u00fa\u010dely zobrazenia.
|
||||
|
||||
config.name.useMinimumStrokeWidth1Px = Minim\u00e1lna \u0161\u00edrka \u0165ahu 1 pixel (ako vo Flashi)
|
||||
config.description.useMinimumStrokeWidth1Px = Pou\u017ei\u0165 1 pixel ako minim\u00e1lnu \u0161\u00edrku \u0165ahu. Flash vykres\u013euje \u0165ahy t\u00fdmto sp\u00f4sobom. Vypnite pre umo\u017enenie ten\u0161\u00edch \u0165ahov.
|
||||
|
||||
Reference in New Issue
Block a user