From c2de50ead013c60732027b82f24d3e69e4803de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Wed, 17 Mar 2021 23:12:23 +0100 Subject: [PATCH] strokes scaling fix --- .../decompiler/flash/exporters/shape/BitmapExporter.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 8b8ca63d4..1df3b0657 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 @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.types.FILLSTYLE; import com.jpexs.decompiler.flash.types.GRADIENT; import com.jpexs.decompiler.flash.types.GRADRECORD; import com.jpexs.decompiler.flash.types.LINESTYLE2; +import com.jpexs.decompiler.flash.types.RECT; import com.jpexs.decompiler.flash.types.RGB; import com.jpexs.decompiler.flash.types.SHAPE; import com.jpexs.helpers.SerializableImage; @@ -155,9 +156,10 @@ public class BitmapExporter extends ShapeExporterBase { private void exportTo(SerializableImage image, Matrix transformation, Matrix strokeTransformation) { this.image = image; - this.strokeTransformation = strokeTransformation.clone(); - this.strokeTransformation.scaleX /= SWF.unitDivisor; - this.strokeTransformation.scaleY /= SWF.unitDivisor; + ExportRectangle bounds = new ExportRectangle(shape.getBounds()); + ExportRectangle transformedBounds = strokeTransformation.transform(bounds); + + this.strokeTransformation = Matrix.getScaleInstance(transformedBounds.getWidth() / bounds.getWidth(), transformedBounds.getHeight() / bounds.getHeight()); graphics = (Graphics2D) image.getGraphics(); AffineTransform at = transformation.toTransform(); @@ -395,7 +397,6 @@ public class BitmapExporter extends ShapeExporterBase { thickness *= Math.max(strokeTransformation.scaleX, strokeTransformation.scaleY); break; case "NONE": - thickness /= SWF.unitDivisor; break; }