From 88d4e768d0a9df8e58827ccbedaf2917b827e7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Wro=CC=81bel?= Date: Thu, 6 Jun 2013 13:38:12 -0700 Subject: [PATCH] Fix image filtering on retina screens. Make sure you get the same pixel count in Safari/Chrome/FF - it should match the pixel count of the image. --- src/shapes/Image.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/shapes/Image.js b/src/shapes/Image.js index d17ef485..7338d012 100644 --- a/src/shapes/Image.js +++ b/src/shapes/Image.js @@ -125,15 +125,16 @@ } else { filterCanvas = this.filterCanvas = new Kinetic.SceneCanvas({ - width: width, - height: height + width: width, + height: height, + pixelRatio: 1 }); } context = filterCanvas.getContext(); try { - this._drawImage(context, [image, 0, 0, width, height]); + this._drawImage(context, [image, 0, 0, filterCanvas.getWidth(), filterCanvas.getHeight()]); imageData = context.getImageData(0, 0, filterCanvas.getWidth(), filterCanvas.getHeight()); filter.call(this, imageData); context.putImageData(imageData, 0, 0);