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