diff --git a/examples/svgMeltedModules.php b/examples/svgMeltedModules.php index 02a63d251..3c1540e54 100644 --- a/examples/svgMeltedModules.php +++ b/examples/svgMeltedModules.php @@ -41,7 +41,7 @@ class MeltedSVGQRCodeOutput extends QRMarkupSVG{ foreach($row as $x => $M_TYPE){ $M_TYPE_LAYER = $M_TYPE; - if($this->connectPaths && !$this->matrix->checkTypeIn($x, $y, $this->excludeFromConnect)){ + if($this->options->connectPaths && !$this->matrix->checkTypeIn($x, $y, $this->options->excludeFromConnect)){ // to connect paths we'll redeclare the $M_TYPE_LAYER to data only $M_TYPE_LAYER = QRMatrix::M_DATA; diff --git a/examples/svgModuleGroupShape.php b/examples/svgModuleGroupShape.php index 1ed5840df..5215a4a4b 100644 --- a/examples/svgModuleGroupShape.php +++ b/examples/svgModuleGroupShape.php @@ -38,7 +38,7 @@ class GroupShapeSVGQRCodeOutput extends QRMarkupSVG{ foreach($row as $x => $M_TYPE){ $M_TYPE_LAYER = $M_TYPE; - if($this->connectPaths && !$this->matrix->checkTypeIn($x, $y, $this->excludeFromConnect)){ + if($this->options->connectPaths && !$this->matrix->checkTypeIn($x, $y, $this->options->excludeFromConnect)){ // to connect paths we'll redeclare the $M_TYPE_LAYER to data only $M_TYPE_LAYER = QRMatrix::M_DATA; diff --git a/examples/svgRandomColoredDots.php b/examples/svgRandomColoredDots.php index a1cdfdc52..8033bad6f 100644 --- a/examples/svgRandomColoredDots.php +++ b/examples/svgRandomColoredDots.php @@ -46,7 +46,7 @@ class RandomDotsSVGOutput extends QRMarkupSVG{ foreach($row as $x => $M_TYPE){ $M_TYPE_LAYER = $M_TYPE; - if($this->connectPaths && !$this->matrix->checkTypeIn($x, $y, $this->excludeFromConnect)){ + if($this->options->connectPaths && !$this->matrix->checkTypeIn($x, $y, $this->options->excludeFromConnect)){ // to connect paths we'll redeclare the $M_TYPE_LAYER to data only $M_TYPE_LAYER = QRMatrix::M_DATA; diff --git a/examples/svgRoundQuietzone.php b/examples/svgRoundQuietzone.php index 7f622d40a..c3b797f42 100644 --- a/examples/svgRoundQuietzone.php +++ b/examples/svgRoundQuietzone.php @@ -167,7 +167,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{ foreach($row as $x => $M_TYPE){ $M_TYPE_LAYER = $M_TYPE; - if($this->connectPaths && !$this->matrix->checkTypeIn($x, $y, $this->excludeFromConnect)){ + if($this->options->connectPaths && !$this->matrix->checkTypeIn($x, $y, $this->options->excludeFromConnect)){ // to connect paths we'll redeclare the $M_TYPE_LAYER to data only $M_TYPE_LAYER = QRMatrix::M_DATA; diff --git a/src/Output/QREps.php b/src/Output/QREps.php index 6d418086d..75fa83687 100644 --- a/src/Output/QREps.php +++ b/src/Output/QREps.php @@ -164,7 +164,7 @@ class QREps extends QROutputAbstract{ */ protected function moduleTransform(int $x, int $y, int $M_TYPE, int $M_TYPE_LAYER):string|null{ - if(!$this->drawLightModules && !$this->matrix->isDark($M_TYPE)){ + if(!$this->options->drawLightModules && !$this->matrix->isDark($M_TYPE)){ return null; } diff --git a/src/Output/QRFpdf.php b/src/Output/QRFpdf.php index 784100a0c..a23bad3b3 100644 --- a/src/Output/QRFpdf.php +++ b/src/Output/QRFpdf.php @@ -103,7 +103,7 @@ class QRFpdf extends QROutputAbstract{ */ protected function module(int $x, int $y, int $M_TYPE):void{ - if(!$this->drawLightModules && !$this->matrix->isDark($M_TYPE)){ + if(!$this->options->drawLightModules && !$this->matrix->isDark($M_TYPE)){ return; } diff --git a/src/Output/QRGdImage.php b/src/Output/QRGdImage.php index 47feb4a01..84bf729e5 100644 --- a/src/Output/QRGdImage.php +++ b/src/Output/QRGdImage.php @@ -71,7 +71,6 @@ abstract class QRGdImage extends QROutputAbstract{ $this->matrix->invert(); } - $this->copyVars(); $this->setMatrixDimensions(); } @@ -200,7 +199,7 @@ abstract class QRGdImage extends QROutputAbstract{ */ protected function createImage():GdImage{ - if($this->drawCircularModules && $this->options->gdImageUseUpscale && $this->options->scale < 20){ + if($this->options->drawCircularModules && $this->options->gdImageUseUpscale && $this->options->scale < 20){ // increase the initial image size by 10 $this->length *= 10; $this->scale *= 10; @@ -275,19 +274,19 @@ abstract class QRGdImage extends QROutputAbstract{ */ protected function module(int $x, int $y, int $M_TYPE):void{ - if(!$this->drawLightModules && !$this->matrix->isDark($M_TYPE)){ + if(!$this->options->drawLightModules && !$this->matrix->isDark($M_TYPE)){ return; } $color = $this->getModuleValue($M_TYPE); - if($this->drawCircularModules && !$this->matrix->checkTypeIn($x, $y, $this->keepAsSquare)){ + if($this->options->drawCircularModules && !$this->matrix->checkTypeIn($x, $y, $this->options->keepAsSquare)){ imagefilledellipse( $this->image, (($x * $this->scale) + intdiv($this->scale, 2)), (($y * $this->scale) + intdiv($this->scale, 2)), - (int)($this->circleDiameter * $this->scale), - (int)($this->circleDiameter * $this->scale), + (int)($this->options->circleRadius * 2 * $this->scale), + (int)($this->options->circleRadius * 2 * $this->scale), $color, ); diff --git a/src/Output/QRImagick.php b/src/Output/QRImagick.php index a6a1b6503..9a753e61b 100644 --- a/src/Output/QRImagick.php +++ b/src/Output/QRImagick.php @@ -197,17 +197,17 @@ class QRImagick extends QROutputAbstract{ */ protected function module(int $x, int $y, int $M_TYPE):void{ - if(!$this->drawLightModules && !$this->matrix->isDark($M_TYPE)){ + if(!$this->options->drawLightModules && !$this->matrix->isDark($M_TYPE)){ return; } $this->imagickDraw->setFillColor($this->getModuleValue($M_TYPE)); - if($this->drawCircularModules && !$this->matrix->checkTypeIn($x, $y, $this->keepAsSquare)){ + if($this->options->drawCircularModules && !$this->matrix->checkTypeIn($x, $y, $this->options->keepAsSquare)){ $this->imagickDraw->circle( (($x + 0.5) * $this->scale), (($y + 0.5) * $this->scale), - (($x + 0.5 + $this->circleRadius) * $this->scale), + (($x + 0.5 + $this->options->circleRadius) * $this->scale), (($y + 0.5) * $this->scale), ); diff --git a/src/Output/QRInterventionImage.php b/src/Output/QRInterventionImage.php index 461fa9dd9..a68fb0faa 100644 --- a/src/Output/QRInterventionImage.php +++ b/src/Output/QRInterventionImage.php @@ -129,19 +129,19 @@ class QRInterventionImage extends QROutputAbstract{ */ protected function module(int $x, int $y, int $M_TYPE):void{ - if(!$this->drawLightModules && !$this->matrix->isDark($M_TYPE)){ + if(!$this->options->drawLightModules && !$this->matrix->isDark($M_TYPE)){ return; } $color = $this->getModuleValue($M_TYPE); - if($this->drawCircularModules && !$this->matrix->checkTypeIn($x, $y, $this->keepAsSquare)){ + if($this->options->drawCircularModules && !$this->matrix->checkTypeIn($x, $y, $this->options->keepAsSquare)){ $this->image->drawCircle( (($x * $this->scale) + intdiv($this->scale, 2)), (($y * $this->scale) + intdiv($this->scale, 2)), function(CircleFactory $circle) use ($color):void{ - $circle->radius((int)($this->circleRadius * $this->scale)); + $circle->radius((int)($this->options->circleRadius * $this->scale)); $circle->background($color); }, ); diff --git a/src/Output/QRMarkupHTML.php b/src/Output/QRMarkupHTML.php index 10e182d32..fa154e06b 100644 --- a/src/Output/QRMarkupHTML.php +++ b/src/Output/QRMarkupHTML.php @@ -28,10 +28,10 @@ class QRMarkupHTML extends QRMarkup{ $element = ''; $modules = array_map(fn(int $M_TYPE):string => sprintf($element, $this->getModuleValue($M_TYPE)), $row); - $rows[] = sprintf('