PaperScript: call the onFrame handler straight away.

This commit is contained in:
Jonathan Puckey 2011-05-08 18:44:33 +01:00
parent 5ddb8e22d3
commit ccf5dd70f6

View file

@ -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;
}
}