From b854b7b7b5dcafa8b4ee074ed7dc472446ab769a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 21 Apr 2025 08:42:43 +0200 Subject: [PATCH] Fixing antialias conflation includes line width --- CHANGELOG.md | 2 +- .../decompiler/flash/exporters/shape/BitmapExporter.java | 4 ++++ .../flash/gui/locales/AdvancedSettingsDialog.properties | 2 +- .../flash/gui/locales/AdvancedSettingsDialog_cs.properties | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 075151d01..e96eb5072 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. ### Added - [#2427] Commandline export with use of imported SWFs (importAssets tag) - Auto detect scale factor on Hi-dpi displays -- [#1826] (Optional) Extending fill area by half pixel to fix antialias conflation artifacts +- [#1826] (Optional) Extending shape area by half pixel to fix antialias conflation artifacts (Can be turned on in advanced settings) ### Fixed 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 890a02453..f41df8ba8 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 @@ -421,6 +421,10 @@ public class BitmapExporter extends ShapeExporterBase { if (thickness * unzoom < 1 * SWF.unitDivisor) { thickness = 1 * SWF.unitDivisor / unzoom; } + + if (Configuration.fixAntialiasConflation.get()) { + thickness += 1 * SWF.unitDivisor / unzoom; + } if (joinStyle == BasicStroke.JOIN_MITER) { //lineStroke = new BasicStroke((float) thickness, capStyle, joinStyle, miterLimit); diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties index dde4f549f..a02073035 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties @@ -430,7 +430,7 @@ config.name.warning.video.vlc = Warn on missing VLC config.description.warning.video.vlc = Show warning about VLC media player required when opening SWFs with DefineVideoStream tags when VLC is not available. config.name.playFrameSounds = Play frame sounds config.description.playFrameSounds = Play sounds on displaying frames. -config.name.fixAntialiasConflation = Extend fill area to fix antialias conflation +config.name.fixAntialiasConflation = Extend shape area to fix antialias conflation config.description.fixAntialiasConflation = Fixes conflation artifacts between adjacent shapes caused by antialiasing by extending contour of shape by half pixel. config.name.autoPlaySounds = Autoplay sounds config.description.autoPlaySounds = Automatically play sounds (DefineSound) on treenode selection. diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties index 76c265095..407c98523 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties @@ -428,7 +428,7 @@ config.name.warning.video.vlc = Varovat p\u0159i chyb\u011bj\u00edc\u00edm VLC config.description.warning.video.vlc = Zobrazovat varov\u00e1n\u00ed o vy\u017eadovan\u00e9m VLC media playeru p\u0159i otev\u00edr\u00e1n\u00ed SWF s DefineVideoStream tagy kdy\u017e je VLC nedostupn\u00fd. config.name.playFrameSounds = P\u0159ehr\u00e1vat sn\u00edmkov\u00e9 zvuky config.description.playFrameSounds = P\u0159ehr\u00e1vat zvuky p\u0159i zobrazov\u00e1n\u00ed sn\u00edmk\u016f. -config.name.fixAntialiasConflation = Roz\u0161\u00ed\u0159it plochu v\u00fdpln\u011b pro opravu konflace antialiasingu +config.name.fixAntialiasConflation = Roz\u0161\u00ed\u0159it plochu tvaru pro opravu konflace antialiasingu config.description.fixAntialiasConflation = Oprav\u00ed konfla\u010dn\u00ed artefakty mezi soused\u00edc\u00edmi tvary zp\u016fsoben\u00e9 antialiasingem roz\u0161\u00ed\u0159en\u00edm obrysu tvaru o p\u016fl pixelu. config.name.autoPlaySounds = Automaticky p\u0159ehr\u00e1vat zvuky config.description.autoPlaySounds = Automaticky p\u0159ehr\u00e1vat zvuky (DefineSound) p\u0159i v\u00fdb\u011bru polo\u017eky ve stromu.