Move get/setContext to get/setCanvas.

This commit is contained in:
Jürg Lehni 2011-03-05 01:59:01 +00:00
parent a365bf45a4
commit e87e7b2582

View file

@ -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