mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -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);
|
DomEvent.requestAnimationFrame(frame, doc && doc.canvas);
|
||||||
onFrame();
|
onFrame();
|
||||||
// Automatically redraw document each frame.
|
// Automatically redraw document each frame.
|
||||||
doc && doc.redraw();
|
if (doc)
|
||||||
}
|
doc.redraw();
|
||||||
DomEvent.requestAnimationFrame(frame, doc && doc.canvas);
|
};
|
||||||
}
|
// Call the onFrame handler and redraw the document:
|
||||||
} catch (e) {
|
frame();
|
||||||
}
|
} else {
|
||||||
// Automatically redraw document at the end.
|
// Automatically redraw document at the end.
|
||||||
if (doc)
|
if (doc)
|
||||||
doc.redraw();
|
doc.redraw();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue