mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Request next animation frame at beginning of callback.
This commit is contained in:
parent
2fcca38a9c
commit
ca9e70ade0
1 changed files with 2 additions and 1 deletions
|
@ -148,10 +148,11 @@ var PaperScript = new function() {
|
|||
var onFrameLoop = eval('onFrameLoop');
|
||||
if (onFrameLoop) {
|
||||
function loop() {
|
||||
// Request next frame already
|
||||
Event.requestAnimationFrame(loop, doc && doc.canvas);
|
||||
onFrameLoop();
|
||||
// Automatically redraw document each frame.
|
||||
doc && doc.redraw();
|
||||
Event.requestAnimationFrame(loop, doc && doc.canvas);
|
||||
}
|
||||
Event.requestAnimationFrame(loop, doc && doc.canvas);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue