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
@@ -272,7 +272,7 @@ void QrCode::drawVersion() {
void QrCode::drawFinderPattern(int x, int y) {
for (int dy = -4; dy <= 4; dy++) {
for (int dx = -4; dx <= 4; dx++) {
int dist = std::max(std::abs(dy), std::abs(dx)); // Chebyshev/infinity norm
int dist = std::max(std::abs(dx), std::abs(dy)); // Chebyshev/infinity norm
int xx = x + dx, yy = y + dy;
if (0 <= xx && xx < size && 0 <= yy && yy < size)
setFunctionModule(xx, yy, dist != 2 && dist != 4);
@@ -284,7 +284,7 @@ void QrCode::drawFinderPattern(int x, int y) {
void QrCode::drawAlignmentPattern(int x, int y) {
for (int dy = -2; dy <= 2; dy++) {
for (int dx = -2; dx <= 2; dx++)
setFunctionModule(x + dx, y + dy, std::max(std::abs(dy), std::abs(dx)) != 1);
setFunctionModule(x + dx, y + dy, std::max(std::abs(dx), std::abs(dy)) != 1);
}
}