diff --git a/CHANGELOG.md b/CHANGELOG.md index 429797e01..6588bfc72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file. - Raw editor item count and edit display - Warnings about invalid reflective access in color dialog on Java 9+ - Folder preview tag names have indices when multiple with same name +- ShapeImporter fillstyles shapenum ### Changed - Quick search needs minimum of 3 characters diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/ShapeImporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/ShapeImporter.java index 56c063344..073a626db 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/ShapeImporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/ShapeImporter.java @@ -59,7 +59,7 @@ public class ShapeImporter { rect.Ymax = rect.Ymin + (int) (SWF.unitDivisor * dimension.getHeight()); } - SHAPEWITHSTYLE shapes = imageTag.getShape(rect, fill); + SHAPEWITHSTYLE shapes = imageTag.getShape(rect, fill, st.getShapeNum()); st.shapes = shapes; return (Tag) st; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java index 869458f54..495fc90bf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java @@ -145,17 +145,18 @@ public abstract class ImageTag extends DrawableTag { return false; } - private SHAPEWITHSTYLE getShape() { + private SHAPEWITHSTYLE getShape(int shapeNum) { RECT rect = getRect(); - return getShape(rect, false); + return getShape(rect, false, shapeNum); } - public SHAPEWITHSTYLE getShape(RECT rect, boolean fill) { + public SHAPEWITHSTYLE getShape(RECT rect, boolean fill, int shapeNum) { boolean translated = rect.Xmin != 0 || rect.Ymin != 0; SHAPEWITHSTYLE shape = new SHAPEWITHSTYLE(); shape.fillStyles = new FILLSTYLEARRAY(); shape.fillStyles.fillStyles = new FILLSTYLE[1]; FILLSTYLE fillStyle = new FILLSTYLE(); + fillStyle.inShape3 = shapeNum >= 3; fillStyle.fillStyleType = Configuration.shapeImportUseNonSmoothedFill.get() ? FILLSTYLE.NON_SMOOTHED_REPEATING_BITMAP : FILLSTYLE.REPEATING_BITMAP; fillStyle.bitmapId = getCharacterId(); @@ -229,23 +230,23 @@ public abstract class ImageTag extends DrawableTag { @Override public Shape getOutline(int frame, int time, int ratio, RenderContext renderContext, Matrix transformation, boolean stroked) { - return transformation.toTransform().createTransformedShape(getShape().getOutline(1, swf, stroked)); + return transformation.toTransform().createTransformedShape(getShape(1).getOutline(1, swf, stroked)); } @Override public void toImage(int frame, int time, int ratio, RenderContext renderContext, SerializableImage image, SerializableImage fullImage, boolean isClip, Matrix transformation, Matrix strokeTransformation, Matrix absoluteTransformation, Matrix fullTransformation, ColorTransform colorTransform, double unzoom, boolean sameImage, ExportRectangle viewRect, boolean scaleStrokes, int drawMode, int blendMode) { - BitmapExporter.export(1, swf, getShape(), null, image, unzoom, transformation, strokeTransformation, colorTransform, true); + BitmapExporter.export(1, swf, getShape(1), null, image, unzoom, transformation, strokeTransformation, colorTransform, true); } @Override public void toSVG(SVGExporter exporter, int ratio, ColorTransform colorTransform, int level) throws IOException { - SVGShapeExporter shapeExporter = new SVGShapeExporter(1, swf, getShape(), getCharacterId(), exporter, null, colorTransform, 1); + SVGShapeExporter shapeExporter = new SVGShapeExporter(1, swf, getShape(1), getCharacterId(), exporter, null, colorTransform, 1); shapeExporter.export(); } @Override public void toHtmlCanvas(StringBuilder result, double unitDivisor) { - CanvasShapeExporter cse = new CanvasShapeExporter(1, null, unitDivisor, swf, getShape(), null, 0, 0); + CanvasShapeExporter cse = new CanvasShapeExporter(1, null, unitDivisor, swf, getShape(1), null, 0, 0); cse.export(); result.append(cse.getShapeData()); }