Skip to content

Commit 2f2ddf3

Browse files
authored
Skip calls to antialiased when it is included (#160)
1 parent e79dc48 commit 2f2ddf3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ export default function pixelmatch(img1, img2, output, width, height, options =
7272
// the color difference is above the threshold
7373
if (Math.abs(delta) > maxDelta) {
7474
// check it's a real rendering difference or just anti-aliasing
75-
const isAA = antialiased(img1, x, y, width, height, a32, b32) || antialiased(img2, x, y, width, height, b32, a32);
76-
if (!includeAA && isAA) {
75+
const isExcludedAA = !includeAA && (antialiased(img1, x, y, width, height, a32, b32) || antialiased(img2, x, y, width, height, b32, a32));
76+
if (isExcludedAA) {
7777
// one of the pixels is anti-aliasing; draw as yellow and do not count as difference
7878
// note that we do not include such pixels in a mask
7979
if (output && !diffMask) drawPixel(output, pos, aaR, aaG, aaB);

0 commit comments

Comments
 (0)