mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-30 12:07:32 +00:00
:octocat: simplify logo space determination
This commit is contained in:
+2
-7
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user