mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42: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');
|
var onFrameLoop = eval('onFrameLoop');
|
||||||
if (onFrameLoop) {
|
if (onFrameLoop) {
|
||||||
function loop() {
|
function loop() {
|
||||||
|
// Request next frame already
|
||||||
|
Event.requestAnimationFrame(loop, doc && doc.canvas);
|
||||||
onFrameLoop();
|
onFrameLoop();
|
||||||
// Automatically redraw document each frame.
|
// Automatically redraw document each frame.
|
||||||
doc && doc.redraw();
|
doc && doc.redraw();
|
||||||
Event.requestAnimationFrame(loop, doc && doc.canvas);
|
|
||||||
}
|
}
|
||||||
Event.requestAnimationFrame(loop, doc && doc.canvas);
|
Event.requestAnimationFrame(loop, doc && doc.canvas);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue