:octocat: require only either $logoSpaceWidth or $logoSpaceHeight

This commit is contained in:
smiley
2023-01-28 16:47:34 +01:00
parent 571d3ea1d9
commit eeb7169d68
5 changed files with 56 additions and 11 deletions
+11 -2
View File
@@ -231,9 +231,18 @@ class QRCode{
// add matrix modifications after mask pattern evaluation and before handing over to output
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;
}
$matrix->setLogoSpace(
$this->options->logoSpaceWidth,
$this->options->logoSpaceHeight,
$logoSpaceWidth,
$logoSpaceHeight,
$this->options->logoSpaceStartX,
$this->options->logoSpaceStartY
);