diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java index aae2c2d47..d57ccdfb3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java @@ -203,10 +203,10 @@ public class DefineScalingGridTag extends Tag implements CharacterIdTag { for (int i = 0; i < targetRect.length; i++) { transforms[i] = rectToRectMatrix(sourceRect[i], targetRect[i]); - targetRect[i].xMax = Math.rint(targetRect[i].xMax / SWF.unitDivisor); + /*targetRect[i].xMax = Math.rint(targetRect[i].xMax / SWF.unitDivisor); targetRect[i].yMax = Math.rint(targetRect[i].yMax / SWF.unitDivisor); targetRect[i].xMin = Math.rint(targetRect[i].xMin / SWF.unitDivisor); - targetRect[i].yMin = Math.rint(targetRect[i].yMin / SWF.unitDivisor); + targetRect[i].yMin = Math.rint(targetRect[i].yMin / SWF.unitDivisor);*/ } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java index d18f7f7e8..16ca7816c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java @@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.timeline; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.exporters.BlendModeSetable; import com.jpexs.decompiler.flash.exporters.FrameExporter; -import com.jpexs.decompiler.flash.exporters.GraphicsGroupable; import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle; import com.jpexs.decompiler.flash.exporters.commonshape.Matrix; import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter; @@ -62,7 +61,6 @@ import com.jpexs.helpers.SerializableImage; import java.awt.AlphaComposite; import java.awt.BasicStroke; import java.awt.Color; -import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; @@ -72,7 +70,6 @@ import java.awt.geom.AffineTransform; import java.awt.geom.Area; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; -import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -80,9 +77,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.Stack; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.imageio.ImageIO; import org.w3c.dom.Element; /** @@ -1041,9 +1035,6 @@ public class Timeline { ExportRectangle[] sourceRect = new ExportRectangle[9]; ExportRectangle[] targetRect = new ExportRectangle[9]; Matrix[] transforms = new Matrix[9]; - //mat => image - //t => - //Matrix tx = transformation.concatenate(layerMatrix); DrawableTag dr = (DrawableTag) character; ExportRectangle boundsRect = new ExportRectangle(dr.getRect()); ExportRectangle targetBoundsRect = layerMatrix.transform(boundsRect); @@ -1056,25 +1047,27 @@ public class Timeline { g.setTransform(new AffineTransform()); ExportRectangle p1 = transformation.transform(targetRect[s]); if (sx == 0) { - p1.xMin = viewRect.xMin; + p1.xMin = 0; } if (sy == 0) { - p1.yMin = viewRect.yMin; + p1.yMin = 0; } if (sx == 2) { - p1.xMax = unzoom * viewRect.getWidth() / SWF.unitDivisor; + p1.xMax = unzoom * viewRect.getWidth(); } if (sy == 2) { - p1.yMax = unzoom * viewRect.getHeight() / SWF.unitDivisor; + p1.yMax = unzoom * viewRect.getHeight(); } + p1.xMin /= SWF.unitDivisor; + p1.xMax /= SWF.unitDivisor; + p1.yMin /= SWF.unitDivisor; + p1.yMax /= SWF.unitDivisor; + Rectangle2D r = new Rectangle2D.Double(p1.xMin, p1.yMin, p1.getWidth(), p1.getHeight()); + g.setClip(r); - if (sx == 1 && sy == 1) { - //System.err.println("xxx"); - } - //Matrix.getScaleInstance(SWF.unitDivisor).concatenate(strokeTransformation).concatenate(transforms[s].inverse()) drawDrawable(strokeTransformation, layer, transforms[s], g, colorTransform, layer.blendMode, clips, transformation, isClip, layer.clipDepth, absMat, time, layer.ratio, renderContext, image, (DrawableTag) character, layer.filters, unzoom, clrTrans, sameImage, viewRect, fullTransformation, false, DRAW_MODE_SHAPES); s++; } @@ -1082,6 +1075,8 @@ public class Timeline { g.setClip(c); g.setTransform(origTransform); + + //draw all nonshapes (normally scaled) next drawDrawable(strokeTransformation, layer, layerMatrix, g, colorTransform, layer.blendMode, clips, transformation, isClip, layer.clipDepth, absMat, time, layer.ratio, renderContext, image, (DrawableTag) character, layer.filters, unzoom, clrTrans, sameImage, viewRect, fullTransformation, scaleStrokes, DRAW_MODE_SPRITES); } else { boolean subScaleStrokes = scaleStrokes; diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics.swf b/libsrc/ffdec_lib/testdata/graphics/graphics.swf index 115a00f80..ba6bb5ed2 100644 Binary files a/libsrc/ffdec_lib/testdata/graphics/graphics.swf and b/libsrc/ffdec_lib/testdata/graphics/graphics.swf differ diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml index 62100154d..249b4c132 100644 --- a/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml +++ b/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml @@ -1,7 +1,7 @@ - + - + @@ -18,11 +18,14 @@ + + + - + @@ -31,9 +34,10 @@ + - + @@ -775,10 +779,10 @@ !3980 1990|2980 1990!2980 1990|2980 990!2980 990|3980 990!3980 990|3980 1990"/> - + @@ -1377,18 +1381,18 @@ - + - - + + @@ -3510,25 +3514,25 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/PinkCircle.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/PinkCircle.xml new file mode 100644 index 000000000..5f25bb253 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/PinkCircle.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/ScaledRect.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/ScaledRect.xml index da340aeeb..8f4c44f65 100644 --- a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/ScaledRect.xml +++ b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/ScaledRect.xml @@ -1,4 +1,4 @@ - + @@ -29,129 +29,99 @@ - + + + + + + + + + + + + + + + + - - - - - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + @@ -302,6 +272,22 @@ + + + + + + + + + + + + + + + + diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/TwoPinkCircles.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/TwoPinkCircles.xml new file mode 100644 index 000000000..c49921742 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/TwoPinkCircles.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/grid.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/grid.xml new file mode 100644 index 000000000..9808d212a --- /dev/null +++ b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/grid.xml @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/pinkSquare.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/pinkSquare.xml new file mode 100644 index 000000000..8f389f88b --- /dev/null +++ b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/pinkSquare.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml index e328d3dfd..7e3b12786 100644 --- a/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml +++ b/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml @@ -5,8 +5,8 @@ xmlns:xmp="http://ns.adobe.com/xap/1.0/"> Adobe Flash Professional CS6 - build 481 2021-03-14T08:29:20+01:00 - 2021-03-28T15:26:11+02:00 - 2021-03-28T15:26:11+02:00 + 2021-03-31T08:35:56+02:00 + 2021-03-31T08:35:56+02:00 @@ -15,7 +15,7 @@ - xmp.iid:320BDF29C98FEB11A065E74797E2312D + xmp.iid:9AAB0C59EB91EB11BA29D0B5CA3B8804 xmp.did:D6D3FE199784EB1187FEAE6972EC5115 xmp.did:D6D3FE199784EB1187FEAE6972EC5115 @@ -92,6 +92,24 @@ 2021-03-14T08:29:20+01:00 Adobe Flash Professional CS6 - build 481 + + created + xmp.iid:AECE20325D90EB119487972065A83CEA + 2021-03-14T08:29:20+01:00 + Adobe Flash Professional CS6 - build 481 + + + created + xmp.iid:FF379EC19791EB119550FD5592C2CFBD + 2021-03-14T08:29:20+01:00 + Adobe Flash Professional CS6 - build 481 + + + created + xmp.iid:9AAB0C59EB91EB11BA29D0B5CA3B8804 + 2021-03-14T08:29:20+01:00 + Adobe Flash Professional CS6 - build 481 + diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache index 969a80c4f..286476ad3 100644 Binary files a/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache and b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache differ diff --git a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index d7cbee949..e38aa654e 100644 --- a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -70,11 +70,9 @@ import java.awt.Shape; import java.awt.Stroke; import java.awt.Toolkit; import java.awt.Transparency; -import java.awt.Window; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.awt.event.InputEvent; -import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -91,7 +89,6 @@ import java.awt.image.VolatileImage; import java.io.IOException; import java.text.DecimalFormat; import java.util.ArrayList; -import java.util.Calendar; import java.util.List; import java.util.Map; import java.util.Timer; @@ -1772,7 +1769,6 @@ public final class ImagePanel extends JPanel implements MediaDisplay { image.fillTransparent(); Matrix m = new Matrix(); - //m.translate(-rect.Xmin * zoom, -rect.Ymin * zoom); m.translate(-viewRect.xMin * zoom, -viewRect.yMin * zoom); m.scale(zoom);