From b049119d149f4c30a09a7d825140547cb2c5650c Mon Sep 17 00:00:00 2001 From: Fabian Lange Date: Tue, 2 Dec 2014 22:13:03 +0100 Subject: [PATCH] removed rounding of values in composeSMaskLuminosity maskData comes out of maskCtx.getImageData, so is 0..255 clamped, and the used multiplications will not create fractions needing rounding, neither would addition. --- src/display/canvas.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/display/canvas.js b/src/display/canvas.js index 688f6435a..c57ef3298 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -639,9 +639,9 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { function composeSMaskLuminosity(maskData, layerData) { var length = maskData.length; for (var i = 3; i < length; i += 4) { - var y = ((maskData[i - 3] * 77) + // * 0.3 / 255 * 0x10000 - (maskData[i - 2] * 152) + // * 0.59 .... - (maskData[i - 1] * 28)) | 0; // * 0.11 .... + var y = (maskData[i - 3] * 77) + // * 0.3 / 255 * 0x10000 + (maskData[i - 2] * 152) + // * 0.59 .... + (maskData[i - 1] * 28); // * 0.11 .... layerData[i] = (layerData[i] * y) >> 16; } }