new Canvas class to decouple layer and canvas, providing more flexibility. drawing operations now require a canvas object rather than an optional layer which contained a canvas. fixed some transformation issues introduced with a pull request that I pulled in last week

This commit is contained in:
Eric Rowell
2012-07-18 23:28:45 -07:00
parent 20adf7e036
commit d8bbbf6353
24 changed files with 548 additions and 555 deletions

View File

@@ -14,9 +14,8 @@ Kinetic.Sprite = Kinetic.Shape.extend({
frameRate: 17
});
config.drawFunc = function() {
config.drawFunc = function(context) {
if(!!this.attrs.image) {
var context = this.getContext();
var anim = this.attrs.animation;
var index = this.attrs.index;
var f = this.attrs.animations[anim][index];
@@ -25,7 +24,7 @@ Kinetic.Sprite = Kinetic.Shape.extend({
context.rect(0, 0, f.width, f.height);
context.closePath();
this.drawImage(this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, f.width, f.height);
this.drawImage(context, this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, f.width, f.height);
}
};
// call super constructor