mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add todo about speeding up canvas clearing.
This commit is contained in:
parent
b9d37e1b9b
commit
d0c2c5dd1d
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue