diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index fbfb4d2..7440a0f 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -416,21 +416,29 @@ if(texture.rotate) { - - // cheeky rotation! - var a = wt.a; - var b = wt.b; - - wt.a = -wt.c; - wt.b = -wt.d; - wt.c = a; - wt.d = b; - width = texture.crop.height; height = texture.crop.width; dx = (texture.trim) ? texture.trim.y - this.anchor.y * texture.trim.height : this.anchor.y * -texture._frame.height; dy = (texture.trim) ? texture.trim.x - this.anchor.x * texture.trim.width : this.anchor.x * -texture._frame.width; + + dx += width; + + wt.tx = dy * wt.a + dx * wt.c + wt.tx; + wt.ty = dy * wt.b + dx * wt.d + wt.ty; + + var temp = wt.a; + wt.a = -wt.c; + wt.c = temp; + + temp = wt.b; + wt.b = -wt.d; + wt.d = temp; + + // the anchor has already been applied above, so lets set it to zero + dx = 0; + dy = 0; + } else {