diff --git a/javascript/qrcodegen.js b/javascript/qrcodegen.js index 0fd17ad..13d7abf 100644 --- a/javascript/qrcodegen.js +++ b/javascript/qrcodegen.js @@ -398,7 +398,8 @@ var qrcodegen = new function() { case 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break; default: throw "Assertion error"; } - modules[y][x] ^= invert & !isFunction[y][x]; + if (!isFunction[y][x] && invert) + modules[y][x] = !modules[y][x]; } } } diff --git a/typescript/qrcodegen.ts b/typescript/qrcodegen.ts index b975987..3ab5c8b 100644 --- a/typescript/qrcodegen.ts +++ b/typescript/qrcodegen.ts @@ -470,7 +470,7 @@ namespace qrcodegen { case 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break; default: throw "Assertion error"; } - if (invert && !this.isFunction[y][x]) + if (!this.isFunction[y][x] && invert) this.modules[y][x] = !this.modules[y][x]; } }