[gnome-control-center] wifi: Avoid padding in hotspot QR code
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] wifi: Avoid padding in hotspot QR code
- Date: Tue, 1 Feb 2022 13:57:25 +0000 (UTC)
commit ebab3214ca29fe871362504d55c356193e8f9432
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Tue Feb 1 18:24:46 2022 +0530
wifi: Avoid padding in hotspot QR code
The padding is now handled by CSS, so we no longer have to set padding
in expense of QR pixel quality
panels/network/cc-qr-code.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
---
diff --git a/panels/network/cc-qr-code.c b/panels/network/cc-qr-code.c
index a277585dd..08f41b5e4 100644
--- a/panels/network/cc-qr-code.c
+++ b/panels/network/cc-qr-code.c
@@ -124,7 +124,7 @@ cc_qr_code_get_paintable (CcQrCode *self,
uint8_t temp_buf[qrcodegen_BUFFER_LEN_FOR_VERSION (qrcodegen_VERSION_MAX)];
g_autoptr(GBytes) bytes = NULL;
GByteArray *qr_matrix;
- gint pixel_size, padding, qr_size, total_size;
+ gint pixel_size, qr_size, total_size;
gint column, row, i;
gboolean success = FALSE;
@@ -156,16 +156,6 @@ cc_qr_code_get_paintable (CcQrCode *self,
qr_size = qrcodegen_getSize(qr_code);
pixel_size = MAX (1, size / (qr_size));
- padding = (size - qr_size * pixel_size) / 2;
-
- /* If subpixel size is big and margin is pretty small,
- * increase the margin */
- if (pixel_size > 4 && padding < 12)
- {
- pixel_size--;
- padding = (size - qr_size * pixel_size) / 2;
- }
-
total_size = qr_size * pixel_size;
qr_matrix = g_byte_array_sized_new (total_size * total_size * pixel_size * BYTES_PER_R8G8B8);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]