mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Use fire('frame') instead of onFrame(), to correctly handle frame events on Node.
This commit is contained in:
parent
ec4f194b84
commit
3224876e6f
1 changed files with 7 additions and 8 deletions
|
@ -207,7 +207,6 @@ CanvasView.inject(new function() {
|
|||
exportFrame(param);
|
||||
|
||||
function exportFrame(param) {
|
||||
count++;
|
||||
var filename = param.prefix + toPaddedString(count, 6) + '.png',
|
||||
path = param.directory + '/' + filename;
|
||||
var out = view.exportImage(path, function() {
|
||||
|
@ -233,13 +232,13 @@ CanvasView.inject(new function() {
|
|||
}
|
||||
}
|
||||
});
|
||||
if (view.onFrame) {
|
||||
view.onFrame({
|
||||
delta: frameDuration,
|
||||
time: frameDuration * count,
|
||||
count: count
|
||||
});
|
||||
}
|
||||
// Use Base.merge to convert into a Base object, for #toString()
|
||||
view.fire('frame', Base.merge({
|
||||
delta: frameDuration,
|
||||
time: frameDuration * count,
|
||||
count: count
|
||||
}));
|
||||
count++;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue