mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 18:30:45 +00:00
Fixed: Flash viewer - scaling grid - ignore nonshapes when scaling
This commit is contained in:
@@ -125,6 +125,11 @@ public class Timeline {
|
||||
|
||||
private Map<String, Integer> labelToFrame = new HashMap<>();
|
||||
|
||||
public static final int DRAW_MODE_ALL = 0;
|
||||
public static final int DRAW_MODE_SHAPES = 1;
|
||||
public static final int DRAW_MODE_SPRITES = 2;
|
||||
|
||||
|
||||
private void ensureInitialized() {
|
||||
if (!initialized) {
|
||||
initialize();
|
||||
@@ -621,7 +626,7 @@ public class Timeline {
|
||||
toImage(frame, time, renderContext, image, isClip, transforms[i], absoluteTransformation, colorTransform, targetRect[i]);
|
||||
}
|
||||
}*/
|
||||
private void drawDrawable(Matrix strokeTransform, DepthState layer, Matrix layerMatrix, Graphics2D g, ColorTransform colorTransForm, int blendMode, List<Clip> clips, Matrix transformation, boolean isClip, int clipDepth, Matrix absMat, int time, int ratio, RenderContext renderContext, SerializableImage image, DrawableTag drawable, List<FILTER> filters, double unzoom, ColorTransform clrTrans, boolean sameImage, ExportRectangle viewRect, Matrix fullTransformation, boolean scaleStrokes) {
|
||||
private void drawDrawable(Matrix strokeTransform, DepthState layer, Matrix layerMatrix, Graphics2D g, ColorTransform colorTransForm, int blendMode, List<Clip> clips, Matrix transformation, boolean isClip, int clipDepth, Matrix absMat, int time, int ratio, RenderContext renderContext, SerializableImage image, DrawableTag drawable, List<FILTER> filters, double unzoom, ColorTransform clrTrans, boolean sameImage, ExportRectangle viewRect, Matrix fullTransformation, boolean scaleStrokes, int drawMode) {
|
||||
Matrix drawMatrix = new Matrix();
|
||||
int drawableFrameCount = drawable.getNumFrames();
|
||||
if (drawableFrameCount == 0) {
|
||||
@@ -796,7 +801,7 @@ public class Timeline {
|
||||
}
|
||||
|
||||
if (!(drawable instanceof ImageTag) || (swf.isAS3() && layer.hasImage)) {
|
||||
drawable.toImage(dframe, time, ratio, renderContext, img, isClip || clipDepth > -1, m, strokeTransform, absMat, mfull, clrTrans2, unzoom, sameImage, viewRect, scaleStrokes);
|
||||
drawable.toImage(dframe, time, ratio, renderContext, img, isClip || clipDepth > -1, m, strokeTransform, absMat, mfull, clrTrans2, unzoom, sameImage, viewRect, scaleStrokes, drawMode);
|
||||
} else {
|
||||
// todo: show one time warning
|
||||
}
|
||||
@@ -929,7 +934,7 @@ public class Timeline {
|
||||
}
|
||||
}
|
||||
|
||||
public void toImage(int frame, int time, RenderContext renderContext, SerializableImage image, boolean isClip, Matrix transformation, Matrix strokeTransformation, Matrix absoluteTransformation, ColorTransform colorTransform, double unzoom, boolean sameImage, ExportRectangle viewRect, Matrix fullTransformation, boolean scaleStrokes) {
|
||||
public void toImage(int frame, int time, RenderContext renderContext, SerializableImage image, boolean isClip, Matrix transformation, Matrix strokeTransformation, Matrix absoluteTransformation, ColorTransform colorTransform, double unzoom, boolean sameImage, ExportRectangle viewRect, Matrix fullTransformation, boolean scaleStrokes, int drawMode) {
|
||||
//double unzoom = SWF.unitDivisor;
|
||||
//unzoom = SWF.unitDivisor;
|
||||
if (getFrameCount() <= frame) {
|
||||
@@ -1017,6 +1022,13 @@ public class Timeline {
|
||||
}
|
||||
|
||||
boolean showPlaceholder = false;
|
||||
|
||||
if (drawMode != DRAW_MODE_ALL && drawMode != DRAW_MODE_SPRITES && !(character instanceof ShapeTag)) {
|
||||
continue;
|
||||
}
|
||||
if (drawMode != DRAW_MODE_ALL && drawMode != DRAW_MODE_SHAPES && (character instanceof ShapeTag)) {
|
||||
continue;
|
||||
}
|
||||
if (character instanceof DrawableTag) {
|
||||
|
||||
RECT scalingRect = null;
|
||||
@@ -1063,19 +1075,20 @@ public class Timeline {
|
||||
//System.err.println("xxx");
|
||||
}
|
||||
//Matrix.getScaleInstance(SWF.unitDivisor).concatenate(strokeTransformation).concatenate(transforms[s].inverse())
|
||||
drawDrawable(strokeTransformation.concatenate(layerMatrix).concatenate(transforms[s].inverse()), 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);
|
||||
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++;
|
||||
}
|
||||
}
|
||||
g.setClip(c);
|
||||
|
||||
g.setTransform(origTransform);
|
||||
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;
|
||||
if (character instanceof DefineSpriteTag) {
|
||||
subScaleStrokes = true;
|
||||
}
|
||||
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, subScaleStrokes);
|
||||
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, subScaleStrokes, DRAW_MODE_ALL);
|
||||
}
|
||||
} else if (character instanceof BoundedTag) {
|
||||
showPlaceholder = true;
|
||||
|
||||
Reference in New Issue
Block a user