:octocat: custom finder example: put patterns in separate path

This commit is contained in:
smiley
2023-10-06 13:38:49 +02:00
parent 5152f929f9
commit 044a7b5df6
+8 -3
View File
@@ -40,8 +40,8 @@ class QRSvgWithLogoAndCustomShapes extends QRMarkupSVG{
// generate the path element(s) - in this case it's just one element as we've "disabled" several options
$svg = parent::paths();
// now we're lazy modifying the generated path to add the custom shapes for the finder patterns
$svg = str_replace('"/>', $this->getFinderPatterns().'"/>', $svg);
// add the custom shapes for the finder patterns
$svg .= $this->getFinderPatterns();
// and add the custom logo
$svg .= $this->getLogo();
@@ -99,7 +99,12 @@ class QRSvgWithLogoAndCustomShapes extends QRMarkupSVG{
$finder[] = sprintf($path, $ix, $iy);
}
return implode(' ', $finder);
return sprintf(
'%s<path class="%s" d="%s"/>',
$this->options->eol,
$this->getCssClass(QRMatrix::M_FINDER_DARK),
implode(' ', $finder)
);
}
/**