From 9fa193d26f372b647c7638b4db8e254586855ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 1 Jun 2011 15:31:02 +0100 Subject: [PATCH] Move opacity precalculation out of variable definition. --- src/util/BlendMode.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/BlendMode.js b/src/util/BlendMode.js index f6991095..6e7b4db8 100644 --- a/src/util/BlendMode.js +++ b/src/util/BlendMode.js @@ -51,7 +51,6 @@ var BlendMode = { src = sourceContext.getImageData(0, 0, sourceCanvas.width, sourceCanvas.height).data, min = Math.min, - opacity = opacity / 255, sA, dA, sAM, dAM, dA2, sRA, sGA, sBA, dRA, dGA, dBA, demultiply; // TODO: Some blend modes seem broken at the moment, e.g. @@ -161,7 +160,7 @@ var BlendMode = { }; var process = modes[blendMode] || modes.unsupported; - + opacity /= 255; for (var i = 0, l = dst.length; i < l; i += 4) { sA = src[i + 3] * opacity; dA = dst[i + 3] / 255;