Skip to content

Commit

Permalink
Merge pull request #476 from Timwi/patch-1
Browse files Browse the repository at this point in the history
Fix ASCII QR codes being diagonally mirrored
  • Loading branch information
codebude authored Apr 7, 2024
2 parents c90e1ef + d25f745 commit b187fdf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions QRCoder/ASCIIQRCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public string[] GetLineByLineGraphic(int repeatPerModule, string darkColorString
var lineBuilder = new StringBuilder();
for (var x = 0; x < QrCodeData.ModuleMatrix.Count - quietZonesModifier; x++)
{
var module = QrCodeData.ModuleMatrix[x + quietZonesOffset][((y + verticalNumberOfRepeats) / verticalNumberOfRepeats - 1)+quietZonesOffset];
var module = QrCodeData.ModuleMatrix[((y + verticalNumberOfRepeats) / verticalNumberOfRepeats - 1)+quietZonesOffset][x + quietZonesOffset];
for (var i = 0; i < repeatPerModule; i++)
{
lineBuilder.Append(module ? darkColorString : whiteSpaceString);
Expand All @@ -75,4 +75,4 @@ public static string GetQRCode(string plainText, int pixelsPerModule, string dar
return qrCode.GetGraphic(pixelsPerModule, darkColorString, whiteSpaceString, drawQuietZones, endOfLine);
}
}
}
}
Loading

0 comments on commit b187fdf

Please sign in to comment.