:octocat: simplify logo space determination

This commit is contained in:
smiley
2024-01-06 17:27:42 +01:00
parent 941b979d2d
commit 1a0208a3e8
+2 -7
View File
@@ -121,14 +121,9 @@ class QRCode{
protected function addMatrixModifications(QRMatrix $matrix):QRMatrix{
if($this->options->addLogoSpace){
$logoSpaceWidth = $this->options->logoSpaceWidth;
$logoSpaceHeight = $this->options->logoSpaceHeight;
// 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(
$logoSpaceWidth,