mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Move stats update to onFrame handler.
This commit is contained in:
parent
df5c33571f
commit
7b03dbedb9
2 changed files with 3 additions and 2 deletions
|
@ -50,8 +50,6 @@ var CanvasView = View.extend(/** @lends CanvasView# */{
|
|||
draw: function(checkRedraw) {
|
||||
if (checkRedraw && !this._redrawNeeded)
|
||||
return false;
|
||||
if (this._stats)
|
||||
this._stats.update();
|
||||
// Initial tests conclude that clearing the canvas using clearRect
|
||||
// is always faster than setting canvas.width = canvas.width
|
||||
// http://jsperf.com/clearrect-vs-setting-width/7
|
||||
|
|
|
@ -58,6 +58,9 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
|||
count: count++
|
||||
}));
|
||||
before = now;
|
||||
// Update framerate stats
|
||||
if (that._stats)
|
||||
that._stats.update();
|
||||
// Automatically draw view on each frame.
|
||||
that.draw(true);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue