diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 6005c4d..0fc14cb 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -63,9 +63,14 @@ CanvasTinter.tintWithMultiply = function (texture, color, canvas) { var context = canvas.getContext( '2d' ); + var crop = texture._frame.clone(); + var resolution = texture.baseTexture.resolution; - var crop = texture._frame; - + crop.x *= resolution; + crop.y *= resolution; + crop.width *= resolution + crop.height *= resolution; + canvas.width = crop.width; canvas.height = crop.height; @@ -112,8 +117,13 @@ CanvasTinter.tintWithOverlay = function (texture, color, canvas) { var context = canvas.getContext( '2d' ); + var crop = texture._frame.clone(); + var resolution = texture.baseTexture.resolution; - var crop = texture._frame; + crop.x *= resolution; + crop.y *= resolution; + crop.width *= resolution + crop.height *= resolution; canvas.width = crop.width; canvas.height = crop.height; @@ -148,7 +158,13 @@ CanvasTinter.tintWithPerPixel = function (texture, color, canvas) { var context = canvas.getContext( '2d' ); - var crop = texture._frame; + var crop = texture._frame.clone(); + var resolution = texture.baseTexture.resolution; + + crop.x *= resolution; + crop.y *= resolution; + crop.width *= resolution + crop.height *= resolution; canvas.width = crop.width; canvas.height = crop.height;