Skip to content

Commit 044a7b5

Browse files
committed
:octocat: custom finder example: put patterns in separate path
1 parent 5152f92 commit 044a7b5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

examples/svgWithLogoAndCustomShapes.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ protected function paths():string{
4040

4141
// generate the path element(s) - in this case it's just one element as we've "disabled" several options
4242
$svg = parent::paths();
43-
// now we're lazy modifying the generated path to add the custom shapes for the finder patterns
44-
$svg = str_replace('"/>', $this->getFinderPatterns().'"/>', $svg);
43+
// add the custom shapes for the finder patterns
44+
$svg .= $this->getFinderPatterns();
4545
// and add the custom logo
4646
$svg .= $this->getLogo();
4747

@@ -99,7 +99,12 @@ protected function getFinderPatterns():string{
9999
$finder[] = sprintf($path, $ix, $iy);
100100
}
101101

102-
return implode(' ', $finder);
102+
return sprintf(
103+
'%s<path class="%s" d="%s"/>',
104+
$this->options->eol,
105+
$this->getCssClass(QRMatrix::M_FINDER_DARK),
106+
implode(' ', $finder)
107+
);
103108
}
104109

105110
/**

0 commit comments

Comments
 (0)