diff --git a/src/core/sprites/canvas/CanvasSpriteRenderer.js b/src/core/sprites/canvas/CanvasSpriteRenderer.js index 118ecdf..700ee9b 100644 --- a/src/core/sprites/canvas/CanvasSpriteRenderer.js +++ b/src/core/sprites/canvas/CanvasSpriteRenderer.js @@ -46,8 +46,8 @@ wt = sprite.transform.worldTransform, dx, dy, - width = texture.crop.width, - height = texture.crop.height; + width = texture._frame.width, + height = texture._frame.height; if (texture.crop.width <= 0 || texture.crop.height <= 0) { @@ -68,18 +68,12 @@ renderer.context[renderer.smoothProperty] = smoothingEnabled; } - - //inline GroupD8.isSwapWidthHeight - if ((texture.rotate & 3) === 2) { - width = texture.crop.height; - height = texture.crop.width; - } if (texture.trim) { - dx = texture.crop.width/2 + texture.trim.x - sprite.anchor.x * texture.trim.width; - dy = texture.crop.height/2 + texture.trim.y - sprite.anchor.y * texture.trim.height; + dx = texture.trim.width/2 + texture.trim.x - this.anchor.x * texture.crop.width; + dy = texture.trim.height/2 + texture.trim.y - this.anchor.y * texture.crop.height; } else { - dx = (0.5 - sprite.anchor.x) * texture._frame.width; - dy = (0.5 - sprite.anchor.y) * texture._frame.height; + dx = (0.5 - this.anchor.x) * texture.crop.width; + dy = (0.5 - this.anchor.y) * texture.crop.height; } if(texture.rotate) { wt.copy(canvasRenderWorldTransform);