mirror of
https://github.com/openharmony/third_party_qrcodegen.git
synced 2026-07-16 08:14:28 -04:00
Swapped {dy,dx} variables in commutative operations for clarity, in all languages.
This commit is contained in:
+2
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user