Swapped {dy,dx} variables in commutative operations for clarity, in all languages.

This commit is contained in:
Project Nayuki
2018-09-17 03:51:57 +00:00
parent 87868d7920
commit 6903d28c90
7 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -327,7 +327,7 @@ class QrCode(object):
xx, yy = x + dx, y + dy
if (0 <= xx < self._size) and (0 <= yy < self._size):
# Chebyshev/infinity norm
self._set_function_module(xx, yy, max(abs(dy), abs(dx)) not in (2, 4))
self._set_function_module(xx, yy, max(abs(dx), abs(dy)) not in (2, 4))
def _draw_alignment_pattern(self, x, y):
@@ -335,7 +335,7 @@ class QrCode(object):
at (x, y). All modules must be in bounds."""
for dy in range(-2, 3):
for dx in range(-2, 3):
self._set_function_module(x + dx, y + dy, max(abs(dy), abs(dx)) != 1)
self._set_function_module(x + dx, y + dy, max(abs(dx), abs(dy)) != 1)
def _set_function_module(self, x, y, isblack):