mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-28 14:45:35 +00:00
Fixed: AS1/2 print/printNum/printAsBitmap/printAsBitmapNum not correctly handling bmovie boundingBox parameter
This commit is contained in:
@@ -93,6 +93,12 @@ public class PrintActionItem extends ActionItem {
|
||||
private List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator, boolean needsReturn) throws CompilationException {
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
String charset = asGenerator.getCharset();
|
||||
if (boundingBox instanceof DirectValueActionItem) {
|
||||
DirectValueActionItem directValue = ((DirectValueActionItem) boundingBox);
|
||||
if (directValue.isString() && "bmovie".equals(directValue.getAsString())) {
|
||||
return toSourceMerge(localData, generator, asGenerator.pushConstTargetItem("print:"), target, new ActionGetURL2(0, false, false, charset), needsReturn ? new ActionPush(new Object[]{Undefined.INSTANCE, Undefined.INSTANCE}, charset) : null);
|
||||
}
|
||||
}
|
||||
return toSourceMerge(localData, generator, new AddActionItem(getSrc(), getLineStartItem(), asGenerator.pushConstTargetItem("print:#"), boundingBox, true), target, new ActionGetURL2(0, false, false, charset), needsReturn ? new ActionPush(new Object[]{Undefined.INSTANCE, Undefined.INSTANCE}, charset) : null);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,12 @@ public class PrintAsBitmapActionItem extends ActionItem {
|
||||
private List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator, boolean needsReturn) throws CompilationException {
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
String charset = asGenerator.getCharset();
|
||||
if (boundingBox instanceof DirectValueActionItem) {
|
||||
DirectValueActionItem directValue = ((DirectValueActionItem) boundingBox);
|
||||
if (directValue.isString() && "bmovie".equals(directValue.getAsString())) {
|
||||
return toSourceMerge(localData, generator, asGenerator.pushConstTargetItem("printasbitmap:"), target, new ActionGetURL2(0, false, false, charset), needsReturn ? new ActionPush(new Object[]{Undefined.INSTANCE, Undefined.INSTANCE}, charset) : null);
|
||||
}
|
||||
}
|
||||
return toSourceMerge(localData, generator, new AddActionItem(getSrc(), getLineStartItem(), asGenerator.pushConstTargetItem("printasbitmap:#"), boundingBox, true), target, new ActionGetURL2(0, false, false, charset), needsReturn ? new ActionPush(new Object[]{Undefined.INSTANCE, Undefined.INSTANCE}, charset) : null);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,13 @@ public class PrintAsBitmapNumActionItem extends ActionItem {
|
||||
} else {
|
||||
lev = new StringAddActionItem(getSrc(), getLineStartItem(), asGenerator.pushConstTargetItem("_level"), num);
|
||||
}
|
||||
|
||||
if (boundingBox instanceof DirectValueActionItem) {
|
||||
DirectValueActionItem directValue = ((DirectValueActionItem) boundingBox);
|
||||
if (directValue.isString() && "bmovie".equals(directValue.getAsString())) {
|
||||
return toSourceMerge(localData, generator, asGenerator.pushConstTargetItem("printasbitmap:"), lev, new ActionGetURL2(0, false, false, charset), needsReturn ? new ActionPush(new Object[]{Undefined.INSTANCE, Undefined.INSTANCE}, charset) : null);
|
||||
}
|
||||
}
|
||||
return toSourceMerge(localData, generator, new AddActionItem(getSrc(), getLineStartItem(), asGenerator.pushConstTargetItem("printasbitmap:#"), boundingBox, true), lev, new ActionGetURL2(0, false, false, charset), needsReturn ? new ActionPush(new Object[]{Undefined.INSTANCE, Undefined.INSTANCE}, charset) : null);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,12 @@ public class PrintNumActionItem extends ActionItem {
|
||||
} else {
|
||||
lev = new StringAddActionItem(getSrc(), getLineStartItem(), asGenerator.pushConstTargetItem("_level"), num);
|
||||
}
|
||||
if (boundingBox instanceof DirectValueActionItem) {
|
||||
DirectValueActionItem directValue = ((DirectValueActionItem) boundingBox);
|
||||
if (directValue.isString() && "bmovie".equals(directValue.getAsString())) {
|
||||
return toSourceMerge(localData, generator, asGenerator.pushConstTargetItem("print:"), lev, new ActionGetURL2(0, false, false, charset), needsReturn ? new ActionPush(new Object[]{Undefined.INSTANCE, Undefined.INSTANCE}, charset) : null);
|
||||
}
|
||||
}
|
||||
return toSourceMerge(localData, generator, new AddActionItem(getSrc(), getLineStartItem(), asGenerator.pushConstTargetItem("print:#"), boundingBox, true), lev, new ActionGetURL2(0, false, false, charset), needsReturn ? new ActionPush(new Object[]{Undefined.INSTANCE, Undefined.INSTANCE}, charset) : null);
|
||||
}
|
||||
|
||||
|
||||
@@ -258,6 +258,12 @@ public class ActionGetURL2 extends Action {
|
||||
} else if (urlStr.startsWith(fscommandPrefix)) {
|
||||
urlString = new DirectValueActionItem(urlStr.substring(fscommandPrefix.length()));
|
||||
doFSCommand = true;
|
||||
} else if (urlStr.equals("print:")) {
|
||||
printType = new DirectValueActionItem("bmovie");
|
||||
doPrint = true;
|
||||
} else if (urlStr.equals("printasbitmap:")) {
|
||||
printType = new DirectValueActionItem("bmovie");
|
||||
doPrintAsBitmap = true;
|
||||
}
|
||||
} else if (urlString instanceof StringAddActionItem) {
|
||||
StringAddActionItem sa = (StringAddActionItem) urlString;
|
||||
@@ -289,8 +295,7 @@ public class ActionGetURL2 extends Action {
|
||||
if (doUnload) {
|
||||
output.add(new UnLoadMovieNumActionItem(this, lineStartAction, num));
|
||||
} else if (doPrint) {
|
||||
output.add(new PrintNumActionItem(this, lineStartAction, num,
|
||||
printType));
|
||||
output.add(new PrintNumActionItem(this, lineStartAction, num, printType));
|
||||
} else if (doPrintAsBitmap) {
|
||||
output.add(new PrintAsBitmapNumActionItem(this, lineStartAction, num, printType));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user