From bec7f5450b45d429dd0e3999b9e92f946902f9d1 Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Thu, 6 Dec 2012 20:16:52 -0800 Subject: [PATCH] removed unecessary rect draw in sprite scene graph draw func, and changed width and height logic in sprite hit graph draw func --- src/shapes/Sprite.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/shapes/Sprite.js b/src/shapes/Sprite.js index 0501f90b..3c06e37e 100644 --- a/src/shapes/Sprite.js +++ b/src/shapes/Sprite.js @@ -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