From 07cb751ee05249282ecfedf62972b41c7b8cf148 Mon Sep 17 00:00:00 2001 From: smiley Date: Fri, 8 Jul 2022 22:24:18 +0200 Subject: [PATCH] :octocat: extreact QROutputAbstract::setMatrixDimensions() --- src/Output/QROutputAbstract.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Output/QROutputAbstract.php b/src/Output/QROutputAbstract.php index 942f0974b..d44479bdb 100644 --- a/src/Output/QROutputAbstract.php +++ b/src/Output/QROutputAbstract.php @@ -60,11 +60,20 @@ abstract class QROutputAbstract implements QROutputInterface{ public function __construct(SettingsContainerInterface $options, QRMatrix $matrix){ $this->options = $options; $this->matrix = $matrix; + + $this->setMatrixDimensions(); + $this->setModuleValues(); + } + + /** + * Sets/updates the matrix dimensions + * + * Call this method if you modify the matrix from within your custom module in case the dimensions have been changed + */ + protected function setMatrixDimensions():void{ $this->moduleCount = $this->matrix->size(); $this->scale = $this->options->scale; $this->length = $this->moduleCount * $this->scale; - - $this->setModuleValues(); } /**