draw methods now draw on both the front and back buffer by default, unless a canvas is passed as an argument. continued fixing up unit tests. Image width and height are now synced whenever the image object changes.

This commit is contained in:
Eric Rowell
2012-08-15 23:13:50 -07:00
parent bae57488cf
commit 6a58830df3
9 changed files with 352 additions and 351 deletions

View File

@@ -25,10 +25,17 @@ Kinetic.Sprite = Kinetic.Shape.extend({
});
},
drawFunc: function(context) {
var anim = this.attrs.animation;
var index = this.attrs.index;
var f = this.attrs.animations[anim][index];
context.beginPath();
context.rect(0, 0, f.width, f.height);
context.closePath();
this.fill(context);
this.stroke(context);
if(this.attrs.image) {
var anim = this.attrs.animation;
var index = this.attrs.index;
var f = this.attrs.animations[anim][index];
context.beginPath();
context.rect(0, 0, f.width, f.height);