Add todo about speeding up canvas clearing.

This commit is contained in:
Jonathan Puckey 2011-02-21 03:52:28 +01:00
parent b9d37e1b9b
commit d0c2c5dd1d

View file

@ -29,6 +29,8 @@ Doc = Base.extend({
redraw: function() { redraw: function() {
if (this.canvas) { 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); this.ctx.clearRect(0, 0, this.size.width + 1, this.size.height);
for (var i = 0, l = this.layers.length; i < l; i++) { for (var i = 0, l = this.layers.length; i < l; i++) {
this.layers[i].draw(this.ctx); this.layers[i].draw(this.ctx);