From 74d983cf2675a7ae96c916094bc1a90bdc612080 Mon Sep 17 00:00:00 2001 From: Chananya Freiman Date: Mon, 12 Dec 2016 12:02:09 +0200 Subject: [PATCH] Corrected the getPixelInfo call in isAntialiased --- resemble.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resemble.js b/resemble.js index 7e67647..0c60d1f 100644 --- a/resemble.js +++ b/resemble.js @@ -285,7 +285,7 @@ URL: https://github.com/Huddle/Resemble.js function isAntialiased(sourcePix, data, cacheSet, verticalPos, horizontalPos, width){ var offset; - var targetPix; + var targetPix = {r: 0, g: 0, b: 0, a: 0}; var distance = 1; var i; var j; @@ -303,9 +303,8 @@ URL: https://github.com/Huddle/Resemble.js } else { offset = ((verticalPos+j)*width + (horizontalPos+i)) * 4; - targetPix = getPixelInfo(data, offset, cacheSet); - if(targetPix === null){ + if(!getPixelInfo(targetPix , data, offset, cacheSet)){ continue; }