commit 8803fd14e8f8d4bf538b8896049f570025b82197 parent 305580fd5ae7deb1a508fed47770e78027f71444 Author: Christian Grothoff <christian@grothoff.org> Date: Sat, 16 Nov 2019 10:51:30 +0100 see stuff Diffstat:
| M | src/main.c | | | 20 | ++++++++++---------- |
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/main.c b/src/main.c @@ -267,7 +267,7 @@ show_qrcode (const char *uri) { unsigned int off = (x * qrc->width / size) + (y * qrc->width / size) * qrc->width; - qrDisplay.memory[(y + yOff) + qrDisplay.var_info.xres * (x + xOff)] = + qrDisplay.memory[(y + yOff) * qrDisplay.var_info.xres + (x + xOff)] = (0 == (qrc->data[off] & 1)) ? 0xFFFF : 0x0000; } #endif @@ -276,21 +276,21 @@ show_qrcode (const char *uri) #if LEGACY if (0 < qrDisplay.devicefd) { - width = qrDisplay.var_info.xres; - height = qrDisplay.var_info.yres; + xwidth = qrDisplay.var_info.xres; + yheight = qrDisplay.var_info.yres; /* show the qrcode */ - xOff = (height - size) / 2; - yOff = (width - size) / 2; - for (size_t row = xOff; row < height; row++) + yOff = (yheight - size) / 2; + xOff = (xwidth - size) / 2; + for (size_t yrow = yOff; row < yheight; yrow++) { - for (size_t col = yOff; col < width; col++) + for (size_t xcol = xOff; col < xwidth; col++) { - if (((row - xOff) < size)&&((col - yOff) < size)) + if (((yrow - yOff) < size)&&((xcol - xOff) < size)) { for (unsigned int c = 0; c < n_channels; c++) { - qrDisplay.memory[(row * width + col)] = - pixels[((row - xOff) * size + (col - yOff)) * n_channels + c]; + qrDisplay.memory[(yrow * xwidth + xcol)] = + pixels[((yrow - yOff) * size + (xcol - xOff)) * n_channels + c]; } } }