From 9bbd5e41ec0dd75a57aa9a63567296056c9d92cc Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Thu, 6 Dec 2012 20:23:18 -0800 Subject: [PATCH] decided to totally revert the pull request. the frame width and height should be used to define the width and height of the sprite frame, not the shape level width and height. This is because the frame height and width can change for different frames --- src/shapes/Sprite.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/shapes/Sprite.js b/src/shapes/Sprite.js index 3c06e37e..62451854 100644 --- a/src/shapes/Sprite.js +++ b/src/shapes/Sprite.js @@ -32,22 +32,18 @@ var anim = this.attrs.animation; var index = this.attrs.index; var f = this.attrs.animations[anim][index]; - var width = f.width || this.attrs.width; - var height = f.height || this.attrs.height; if(this.attrs.image) { - this.drawImage(context, this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, width, height); + this.drawImage(context, this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, f.width, f.height); } }, drawHitFunc: function(context) { var anim = this.attrs.animation; var index = this.attrs.index; var f = this.attrs.animations[anim][index]; - var width = f.width || this.attrs.width; - var height = f.height || this.attrs.height; - + context.beginPath(); - context.rect(0, 0, width, height); + context.rect(0, 0, f.width, f.height); context.closePath(); this.fill(context); },