From 720c904d2f4f67049c2ef3df157bfd29d2d6ca56 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sun, 14 May 2017 14:44:13 -0400 Subject: [PATCH] Fixed size issues with Datamatrix barcodes. --- glbarcode/Barcode2dBase.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/glbarcode/Barcode2dBase.cpp b/glbarcode/Barcode2dBase.cpp index 6b4ebd5..5f1a56f 100644 --- a/glbarcode/Barcode2dBase.cpp +++ b/glbarcode/Barcode2dBase.cpp @@ -128,22 +128,12 @@ namespace glbarcode double minW = MIN_CELL_SIZE*encodedData.nx() + 2*MIN_CELL_SIZE; double minH = MIN_CELL_SIZE*encodedData.ny() + 2*MIN_CELL_SIZE; - if ( (w <= minW) && (h <= minH) ) + if ( (w <= minW) || (h <= minH) ) { scale = 1; w = minW; h = minH; } - else if ( w <= minW ) - { - scale = h / minH; - w = scale * minW; - } - else if ( h <= minH ) - { - scale = w / minW; - h = scale * minH; - } else { scale = std::min( w / minW, h / minH );