mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Rename loop function to frame.
This commit is contained in:
parent
a20f988511
commit
189182b77c
1 changed files with 5 additions and 5 deletions
|
@ -147,14 +147,14 @@ var PaperScript = new function() {
|
||||||
try {
|
try {
|
||||||
var onFrame = eval('onFrame');
|
var onFrame = eval('onFrame');
|
||||||
if (onFrame) {
|
if (onFrame) {
|
||||||
function loop() {
|
function frame() {
|
||||||
// Request next frame already
|
// Request next frame already
|
||||||
Event.requestAnimationFrame(loop, doc && doc.canvas);
|
Event.requestAnimationFrame(frame, doc && doc.canvas);
|
||||||
onFrame();
|
onFrame();
|
||||||
// Automatically redraw document each frame.
|
// Automatically redraw document each frame.
|
||||||
doc && doc.redraw();
|
doc && doc.redraw();
|
||||||
}
|
}
|
||||||
Event.requestAnimationFrame(loop, doc && doc.canvas);
|
Event.requestAnimationFrame(frame, doc && doc.canvas);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
|
@ -167,8 +167,8 @@ var PaperScript = new function() {
|
||||||
//#ifdef BROWSER
|
//#ifdef BROWSER
|
||||||
// Code borrowed from Coffee Script:
|
// Code borrowed from Coffee Script:
|
||||||
function request(url) {
|
function request(url) {
|
||||||
var xhr = new (window.ActiveXObject
|
var xhr = new (window.ActiveXObject || XMLHttpRequest)(
|
||||||
|| XMLHttpRequest)('Microsoft.XMLHTTP');
|
'Microsoft.XMLHTTP');
|
||||||
xhr.open('GET', url, true);
|
xhr.open('GET', url, true);
|
||||||
if ('overrideMimeType' in xhr) {
|
if ('overrideMimeType' in xhr) {
|
||||||
xhr.overrideMimeType('text/plain');
|
xhr.overrideMimeType('text/plain');
|
||||||
|
|
Loading…
Reference in a new issue