mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Doc: Change comment about using canvas.width = canvas.width instead of context.clearRect.
This commit is contained in:
parent
8cf2f54d5f
commit
1a6c5c8c6f
1 changed files with 4 additions and 3 deletions
|
@ -29,9 +29,10 @@ Doc = Base.extend({
|
|||
|
||||
redraw: function() {
|
||||
if (this.canvas) {
|
||||
// TODO: clearing the canvas by setting
|
||||
// this.canvas.width = this.canvas.width might be faster..
|
||||
this.ctx.clearRect(0, 0, this.size.width + 1, this.size.height);
|
||||
// Initial tests conclude that clearing the canvas is always
|
||||
// faster than using clearRect:
|
||||
// http://jsperf.com/clearrect-vs-setting-width/7
|
||||
this.ctx.clearRect(0, 0, this.size.width + 1, this.size.height + 1);
|
||||
for (var i = 0, l = this.layers.length; i < l; i++) {
|
||||
this.layers[i].draw(this.ctx, {});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue