mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
PaperScript: call the onFrame handler straight away.
This commit is contained in:
parent
5ddb8e22d3
commit
ccf5dd70f6
1 changed files with 9 additions and 6 deletions
|
@ -154,15 +154,18 @@ var PaperScript = this.PaperScript = new function() {
|
|||
DomEvent.requestAnimationFrame(frame, doc && doc.canvas);
|
||||
onFrame();
|
||||
// Automatically redraw document each frame.
|
||||
doc && doc.redraw();
|
||||
}
|
||||
DomEvent.requestAnimationFrame(frame, doc && doc.canvas);
|
||||
if (doc)
|
||||
doc.redraw();
|
||||
};
|
||||
// Call the onFrame handler and redraw the document:
|
||||
frame();
|
||||
} else {
|
||||
// Automatically redraw document at the end.
|
||||
if (doc)
|
||||
doc.redraw();
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
// Automatically redraw document at the end.
|
||||
if (doc)
|
||||
doc.redraw();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue