mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-25 08:17:54 +00:00
🚿
This commit is contained in:
@@ -56,7 +56,7 @@ class GroupShapeSVGQRCodeOutput extends QRMarkupSVG{
|
||||
// collect the modules per $M_TYPE
|
||||
$module = $this->moduleTransform($x, $y, $M_TYPE, $M_TYPE_LAYER);
|
||||
|
||||
if(!empty($module)){
|
||||
if($module !== null){
|
||||
$paths[$M_TYPE_LAYER][] = $module;
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ class GroupShapeSVGQRCodeOutput extends QRMarkupSVG{
|
||||
return $paths;
|
||||
}
|
||||
|
||||
protected function moduleTransform(int $x, int $y, int $M_TYPE, int $M_TYPE_LAYER):string{
|
||||
protected function moduleTransform(int $x, int $y, int $M_TYPE, int $M_TYPE_LAYER):string|null{
|
||||
$bits = $this->matrix->checkNeighbours($x, $y, null);
|
||||
$check = fn(int $all, int $any = 0):bool => ($bits & ($all | (~$any & 0xff))) === $all;
|
||||
|
||||
@@ -76,6 +76,10 @@ class GroupShapeSVGQRCodeOutput extends QRMarkupSVG{
|
||||
? $this->darkModule($check, $this->options->inverseMelt)
|
||||
: $this->lightModule($check, $this->options->inverseMelt);
|
||||
|
||||
if($template === ''){
|
||||
return null;
|
||||
}
|
||||
|
||||
$r = $this->options->meltRadius;
|
||||
|
||||
return sprintf($template, $x, $y, $r, (1 - $r), (1 - 2 * $r));
|
||||
|
||||
Reference in New Issue
Block a user