mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Add Raster.clear() to clear associated canvas
This commit is contained in:
parent
e436d44f14
commit
ea91efe810
1 changed files with 8 additions and 0 deletions
|
@ -680,6 +680,14 @@ var Raster = Item.extend(/** @lends Raster# */{
|
||||||
ctx.putImageData(imageData, point.x, point.y);
|
ctx.putImageData(imageData, point.x, point.y);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the image, if it is backed by a canvas.
|
||||||
|
*/
|
||||||
|
clear: function() {
|
||||||
|
var size = this._size;
|
||||||
|
this.getContext().clearRect(0, 0, size.width + 1, size.height + 1);
|
||||||
|
},
|
||||||
|
|
||||||
// DOCS: document Raster#createImageData
|
// DOCS: document Raster#createImageData
|
||||||
/**
|
/**
|
||||||
* {@grouptitle Image Data}
|
* {@grouptitle Image Data}
|
||||||
|
|
Loading…
Reference in a new issue