gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-mdb] 66/93: swap xy


From: gnunet
Subject: [taler-taler-mdb] 66/93: swap xy
Date: Mon, 18 Nov 2019 21:13:29 +0100

This is an automated email from the git hooks/post-receive script.

marco-boss pushed a commit to branch master
in repository taler-mdb.

commit 79ed7e22696f9fae6f8d117d924baa837b13ee25
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Nov 16 10:42:57 2019 +0100

    swap xy
---
 src/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c
index 238ae71..1e59397 100644
--- a/src/main.c
+++ b/src/main.c
@@ -244,7 +244,8 @@ show_qrcode (const char *uri)
   size = GNUNET_MIN (qrDisplay.var_info.xres,
                      qrDisplay.var_info.yres);
   size /= 2;
-  scale = size / (qrc->width + 8);
+  unsigned int width = qrc->width + 8; // 4 pixel border
+  scale = size / width;
 #if LEGACY
   pixels = GNUNET_malloc (size * size * n_channels);
 #endif
@@ -259,7 +260,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.yres * (x + xOff)] =
         (0 == (qrc->data[off] & 1)) ? 0xFFFF : 0x0000;
     }
 
@@ -354,7 +355,7 @@ cleanup_payment (struct PaymentActivity *pa)
     {
       for (size_t col = 0; col < qrDisplay.var_info.xres; col++)
       {
-        qrDisplay.memory[(row * qrDisplay.var_info.xres + col)] = 0xFF;
+        qrDisplay.memory[(row * qrDisplay.var_info.xres + col)] = 0xFFFF;
       }
     }
   }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]