From db02d612804d78badb47d42f000d8866263b6c03 Mon Sep 17 00:00:00 2001 From: Michael Hollister Date: Mon, 3 Mar 2025 17:00:10 -0600 Subject: [PATCH] Fixed alignemnt pattern position array order --- components/qrCode/qrCode.help.brs | 4 ++-- components/qrCode/qrCode.utils.brs | 18 ------------------ 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/components/qrCode/qrCode.help.brs b/components/qrCode/qrCode.help.brs index 9f824e5..d5bdd1d 100644 --- a/components/qrCode/qrCode.help.brs +++ b/components/qrCode/qrCode.help.brs @@ -9,10 +9,10 @@ function _qrCode_help_getAlignmentPatternPositions() as object else numAlign = floor(m.version / 7) + 2 stepSize = iif(m.version = 32, 26, ceil((m.version * 4 + 4) / (numAlign * 2 - 2)) * 2) - result = [6] + result = [] position = m.size - 7 while(result.count() < numAlign) - splice(result, 1, 0, [position]) + result.unshift(position) position -= stepSize end while return result diff --git a/components/qrCode/qrCode.utils.brs b/components/qrCode/qrCode.utils.brs index 9f72a83..89b46d9 100644 --- a/components/qrCode/qrCode.utils.brs +++ b/components/qrCode/qrCode.utils.brs @@ -81,24 +81,6 @@ function concat(array1 as object, array2 as object) as object return new end function -function splice(array as object, start as integer, delete = 999999 as integer, insert = [] as object) - if start > array.count() - 1 then start = array.count() - 1 - if start < 0 then start = array.count() - start - if start < 0 then start = 0 - if delete < 0 then delete = 0 - for d = 1 to delete - array.delete(start) - next - tmp = [] - tmp.append(insert) - while(array.count() - 1 > start) - tmp.push(array[start]) - array.delete(start) - end while - array.append(tmp) - return array -end function - function infinity() return 999999 end function