소스 검색

:octocat: simplify logo space determination

smiley 2 년 전
부모
커밋
1a0208a3e8
1개의 변경된 파일2개의 추가작업 그리고 7개의 파일을 삭제
  1. 2 7
      src/QRCode.php

+ 2 - 7
src/QRCode.php

@@ -121,14 +121,9 @@ class QRCode{
 	protected function addMatrixModifications(QRMatrix $matrix):QRMatrix{
 	protected function addMatrixModifications(QRMatrix $matrix):QRMatrix{
 
 
 		if($this->options->addLogoSpace){
 		if($this->options->addLogoSpace){
-			$logoSpaceWidth  = $this->options->logoSpaceWidth;
-			$logoSpaceHeight = $this->options->logoSpaceHeight;
-
 			// check whether one of the dimensions was omitted
 			// check whether one of the dimensions was omitted
-			if($logoSpaceWidth === null || $logoSpaceHeight === null){
-				$logoSpaceWidth  = ($logoSpaceWidth ?? $logoSpaceHeight ?? 0);
-				$logoSpaceHeight = null;
-			}
+			$logoSpaceWidth  = ($this->options->logoSpaceWidth ?? $this->options->logoSpaceHeight ?? 0);
+			$logoSpaceHeight = ($this->options->logoSpaceHeight ?? $logoSpaceWidth);
 
 
 			$matrix->setLogoSpace(
 			$matrix->setLogoSpace(
 				$logoSpaceWidth,
 				$logoSpaceWidth,