Просмотр исходного кода

:sparkles: use module values or fall back to defaults

smiley 8 лет назад
Родитель
Сommit
f388ff8c4b
1 измененных файлов с 9 добавлено и 3 удалено
  1. 9 3
      src/Output/QRString.php

+ 9 - 3
src/Output/QRString.php

@@ -42,9 +42,15 @@ class QRString extends QROutputAbstract{
 
 		foreach($this->matrix->matrix() as $row){
 			foreach($row as $col){
-				$str .= $col >> 8 > 0
-					? $this->options->textDark
-					: $this->options->textLight;
+				$col = $this->options->moduleValues[$col];
+				
+				// fallback
+				if(is_bool($col) || !is_string($col)){
+					$col = $col ? $this->options->textDark : $this->options->textLight;
+				}
+
+
+				$str .= $col;
 			}
 
 			$str .= $this->options->eol;