Преглед изворни кода

:shower: don't auto adjust logo space if start values are given

codemasher пре 5 година
родитељ
комит
f50dc3f856
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      src/Data/QRMatrix.php

+ 3 - 3
src/Data/QRMatrix.php

@@ -589,12 +589,12 @@ class QRMatrix{
 			throw new QRCodeDataException('ECC level "H" required to add logo space');
 			throw new QRCodeDataException('ECC level "H" required to add logo space');
 		}
 		}
 
 
-		// we need uneven sizes, adjust if needed
-		if(($width % 2) === 0){
+		// we need uneven sizes to center the logo space, adjust if needed
+		if($startX === null && ($width % 2) === 0){
 			$width++;
 			$width++;
 		}
 		}
 
 
-		if(($height % 2) === 0){
+		if($startY === null && ($height % 2) === 0){
 			$height++;
 			$height++;
 		}
 		}