Skip to content

Commit 366c1d5

Browse files
authored
Update ArtQRCode.cs
Fixed dot size calculaction
1 parent cecf206 commit 366c1d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

QRCoder/ArtQRCode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public Bitmap GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor,
6565
{
6666
if (pixelSizeFactor > 1)
6767
throw new Exception("The parameter pixelSize must be between 0 and 1. (0-100%)");
68-
int pixelSize = (int)Math.Min(pixelsPerModule, Math.Floor(pixelsPerModule / pixelSizeFactor));
68+
int pixelSize = (int)Math.Min(pixelsPerModule, Math.Floor(pixelsPerModule * pixelSizeFactor));
6969

7070
var numModules = QrCodeData.ModuleMatrix.Count - (drawQuietZones ? 0 : 8);
7171
var offset = (drawQuietZones ? 0 : 4);
@@ -295,4 +295,4 @@ public static Bitmap GetQRCode(string plainText, int pixelsPerModule, Color dark
295295
}
296296
}
297297

298-
#endif
298+
#endif

0 commit comments

Comments
 (0)