removed unecessary rect draw in sprite scene graph draw func, and changed width and height logic in sprite hit graph draw func

This commit is contained in:
Eric Rowell
2012-12-06 20:16:52 -08:00
parent df63558686
commit bec7f5450b

View File

@@ -36,11 +36,6 @@
var height = f.height || this.attrs.height;
if(this.attrs.image) {
context.beginPath();
context.rect(0, 0, width, height);
context.closePath();
this.drawImage(context, this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, width, height);
}
},
@@ -48,13 +43,13 @@
var anim = this.attrs.animation;
var index = this.attrs.index;
var f = this.attrs.animations[anim][index];
var width = this.attrs.width || f.width;
var height = this.attrs.height || f.height;
var width = f.width || this.attrs.width;
var height = f.height || this.attrs.height;
context.beginPath();
context.rect(0, 0, width, height);
context.closePath();
this.fillStroke(context);
this.fill(context);
},
/**
* start sprite animation