flash player zoom fix, html5 export fixed when framerate=0

This commit is contained in:
honfika@gmail.com
2014-12-04 19:27:58 +01:00
parent 9ca752dfca
commit 5d9be4a0da
5 changed files with 25 additions and 10 deletions

View File

@@ -1435,13 +1435,18 @@ public final class SWF implements SWFContainerItem, Timelined {
fos.write(Utf8Helper.getBytes("\t" + currentName + "(ctx,ctrans,frames[frame],0,time);\r\n"));
fos.write(Utf8Helper.getBytes("\tctx.restore();\r\n"));
fos.write(Utf8Helper.getBytes("}\r\n\r\n"));
fos.write(Utf8Helper.getBytes("window.setInterval(function(){nextFrame(ctx,ctrans);}," + (int) (1000.0 / ftim.swf.frameRate) + ");\r\n"));
if (ftim.swf.frameRate > 0) {
fos.write(Utf8Helper.getBytes("window.setInterval(function(){nextFrame(ctx,ctrans);}," + (int) (1000.0 / ftim.swf.frameRate) + ");\r\n"));
}
fos.write(Utf8Helper.getBytes("nextFrame(ctx,ctrans);\r\n"));
}
boolean packed = false;
if (Configuration.packJavaScripts.get()) {
try {
JPacker.main(new String[]{"-q", "-b", "62", "-o", fmin.getAbsolutePath(), f.getAbsolutePath()});
f.delete();
packed = true;
} catch (Exception | Error e) { //Something wrong in the packer
logger.log(Level.WARNING, "JPacker: Cannot minimize script");
f.renameTo(fmin);
@@ -1459,7 +1464,7 @@ public final class SWF implements SWFContainerItem, Timelined {
while ((cnt = fis.read(buf)) > 0) {
fos.write(buf, 0, cnt);
}
if (Configuration.packJavaScripts.get()) {
if (packed) {
fos.write(Utf8Helper.getBytes(";"));
}
fos.write(Utf8Helper.getBytes(CanvasShapeExporter.getJsSuffix()));