This commit is contained in:
honfika@gmail.com
2016-03-19 17:42:37 +01:00
parent 8f8b0a0690
commit db10ce12e8
6 changed files with 18 additions and 33 deletions

View File

@@ -2668,7 +2668,7 @@ public final class SWF implements SWFContainerItem, Timelined {
return ret;
}
public static SerializableImage frameToImageGet(Timeline timeline, int frame, int time, Point cursorPosition, int mouseButton, RECT displayRect, Matrix transformation, Matrix absoluteTransformation, ColorTransform colorTransform, Color backGroundColor, double zoom) {
public static SerializableImage frameToImageGet(Timeline timeline, int frame, int time, Point cursorPosition, int mouseButton, RECT displayRect, Matrix transformation, ColorTransform colorTransform, Color backGroundColor, double zoom) {
if (timeline.getFrameCount() == 0) {
return new SerializableImage(1, 1, SerializableImage.TYPE_INT_ARGB);
}
@@ -2691,7 +2691,7 @@ public final class SWF implements SWFContainerItem, Timelined {
RenderContext renderContext = new RenderContext();
renderContext.cursorPosition = cursorPosition;
renderContext.mouseButton = mouseButton;
timeline.toImage(frame, time, renderContext, image, false, m, transformation, absoluteTransformation, colorTransform);
timeline.toImage(frame, time, renderContext, image, false, m, transformation, m, colorTransform);
return image;
}

View File

@@ -360,7 +360,7 @@ public class FrameExporter {
}
int fframe = fframes.get(pos++);
BufferedImage result = SWF.frameToImageGet(ftim, fframe, fframe, null, 0, ftim.displayRect, new Matrix(), new Matrix(), null, fbackgroundColor, settings.zoom).getBufferedImage();
BufferedImage result = SWF.frameToImageGet(ftim, fframe, fframe, null, 0, ftim.displayRect, new Matrix(), null, fbackgroundColor, settings.zoom).getBufferedImage();
if (evl != null) {
evl.handleExportedEvent("frame", pos, fframes.size(), tagName);

View File

@@ -638,7 +638,7 @@ public class Timeline {
return;
}
m.translate(-rect.xMin, -rect.yMin);
m = m.preConcatenate(Matrix.getTranslateInstance(-rect.xMin, -rect.yMin));
//strokeTransform = strokeTransform.clone();
//strokeTransform.translate(-rect.xMin, -rect.yMin);
drawMatrix.translate(rect.xMin, rect.yMin);
@@ -760,8 +760,6 @@ public class Timeline {
gm.drawImage(img.getBufferedImage(), 0, 0, null);
Clip clip = new Clip(Helper.imageToShape(mask), clipDepth); // Maybe we can get current outline instead converting from image (?)
clips.add(clip);
g.setTransform(new AffineTransform());
g.setClip(clip.shape);
} else {
if (renderContext.cursorPosition != null) {
if (drawable instanceof DefineSpriteTag) {
@@ -784,20 +782,8 @@ public class Timeline {
g2.draw(shape);
}
Shape prevClip = g.getClip();
if (prevClip != null) {
g.setTransform(new AffineTransform());
g.setClip(prevClip);
// draw clip border
// g.setPaint(Color.red);
// g.setStroke(new BasicStroke(2));
// g.draw(prevClip);
}
g.setTransform(trans);
g.drawImage(img.getBufferedImage(), 0, 0, null);
g.setClip(prevClip);
}
}
@@ -843,7 +829,13 @@ public class Timeline {
}
}
g.setTransform(new AffineTransform());
g.setClip(clip);
// draw clip border
//g.setPaint(Color.red);
//g.setStroke(new BasicStroke(2));
//g.draw(clip);
} else {
g.setClip(null);
}
@@ -901,7 +893,7 @@ public class Timeline {
Rectangle2D r = new Rectangle2D.Double(p1.xMin, p1.yMin, p1.getWidth(), p1.getHeight());
g.setClip(r);
drawDrawable(strokeTransformation.preConcatenate(layerMatrix), layer, transforms[s], g, colorTransform, layer.blendMode, clips, transformation.clone(), isClip, layer.clipDepth, absMat, time, layer.ratio, renderContext, image, (DrawableTag) character, layer.filters, unzoom, clrTrans);
drawDrawable(strokeTransformation.preConcatenate(layerMatrix), layer, transforms[s], g, colorTransform, layer.blendMode, clips, transformation, isClip, layer.clipDepth, absMat, time, layer.ratio, renderContext, image, (DrawableTag) character, layer.filters, unzoom, clrTrans);
}
g.setClip(c);
@@ -919,7 +911,7 @@ public class Timeline {
}*/
g.setTransform(origTransform);
} else {
drawDrawable(strokeTransformation, layer, layerMatrix, g, colorTransform, layer.blendMode, clips, transformation.clone(), isClip, layer.clipDepth, absMat, time, layer.ratio, renderContext, image, (DrawableTag) character, layer.filters, unzoom, clrTrans);
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);
}
} else if (character instanceof BoundedTag) {
showPlaceholder = true;
@@ -957,7 +949,7 @@ public class Timeline {
}
}
g.setTransform(AffineTransform.getScaleInstance(1, 1));
g.setTransform(new AffineTransform());
g.setClip(prevClip);
}