From 044a7b5df6fc3cf176127628161bf1603f86fb18 Mon Sep 17 00:00:00 2001 From: smiley Date: Fri, 6 Oct 2023 13:38:49 +0200 Subject: [PATCH] :octocat: custom finder example: put patterns in separate path --- examples/svgWithLogoAndCustomShapes.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/svgWithLogoAndCustomShapes.php b/examples/svgWithLogoAndCustomShapes.php index e2f3067ba..3c82a0294 100644 --- a/examples/svgWithLogoAndCustomShapes.php +++ b/examples/svgWithLogoAndCustomShapes.php @@ -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', + $this->options->eol, + $this->getCssClass(QRMatrix::M_FINDER_DARK), + implode(' ', $finder) + ); } /**