mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Move get/setContext to get/setCanvas.
This commit is contained in:
parent
a365bf45a4
commit
e87e7b2582
1 changed files with 11 additions and 11 deletions
|
@ -75,6 +75,17 @@ var Raster = this.Raster = Item.extend({
|
|||
this._bounds = null;
|
||||
},
|
||||
|
||||
getContext: function() {
|
||||
if (!this._context) {
|
||||
this._context = this.getCanvas().getContext('2d');
|
||||
}
|
||||
return this._context;
|
||||
},
|
||||
|
||||
setContext: function(context) {
|
||||
this._context = context;
|
||||
},
|
||||
|
||||
getImage: function() {
|
||||
return this._image || this.getCanvas();
|
||||
},
|
||||
|
@ -134,17 +145,6 @@ var Raster = this.Raster = Item.extend({
|
|||
ctx.putImageData(imageData, x, y);
|
||||
},
|
||||
|
||||
getContext: function() {
|
||||
if (!this._context) {
|
||||
this._context = this.getCanvas().getContext('2d');
|
||||
}
|
||||
return this._context;
|
||||
},
|
||||
|
||||
setContext: function(context) {
|
||||
this._context = context;
|
||||
},
|
||||
|
||||
_transform: function(matrix, flags) {
|
||||
// In order to set the right context transformation when drawing the
|
||||
// raster, simply preconcatenate the internal matrix with the provided
|
||||
|
|
Loading…
Reference in a new issue