diff --git a/src/Renderer/Image/SvgImageBackEnd.php b/src/Renderer/Image/SvgImageBackEnd.php index 44d014e..dd5896d 100644 --- a/src/Renderer/Image/SvgImageBackEnd.php +++ b/src/Renderer/Image/SvgImageBackEnd.php @@ -19,8 +19,6 @@ final class SvgImageBackEnd implements ImageBackEndInterface { private const PRECISION = 3; - private const SCALE_FORMAT = 'scale(%.' . self::PRECISION . 'F)'; - private const TRANSLATE_FORMAT = 'translate(%.' . self::PRECISION . 'F,%.' . self::PRECISION . 'F)'; private ?XMLWriter $xmlWriter; @@ -87,7 +85,7 @@ public function scale(float $size) : void $this->xmlWriter->startElement('g'); $this->xmlWriter->writeAttribute( 'transform', - sprintf(self::SCALE_FORMAT, round($size, self::PRECISION)) + sprintf('scale(%s)', round($size, self::PRECISION)) ); ++$this->stack[$this->currentStack]; } @@ -101,7 +99,7 @@ public function translate(float $x, float $y) : void $this->xmlWriter->startElement('g'); $this->xmlWriter->writeAttribute( 'transform', - sprintf(self::TRANSLATE_FORMAT, round($x, self::PRECISION), round($y, self::PRECISION)) + sprintf('translate(%s,%s)', round($x, self::PRECISION), round($y, self::PRECISION)) ); ++$this->stack[$this->currentStack]; } diff --git a/test/Integration/__snapshots__/SVGRenderingTest__testGenericQrCode__1.xml b/test/Integration/__snapshots__/SVGRenderingTest__testGenericQrCode__1.xml index b602bbb..6f91413 100644 --- a/test/Integration/__snapshots__/SVGRenderingTest__testGenericQrCode__1.xml +++ b/test/Integration/__snapshots__/SVGRenderingTest__testGenericQrCode__1.xml @@ -2,7 +2,7 @@ - + diff --git a/test/Integration/__snapshots__/SVGRenderingTest__testQrWithGradientGeneratesDifferentIdsForDifferentGradients__1.xml b/test/Integration/__snapshots__/SVGRenderingTest__testQrWithGradientGeneratesDifferentIdsForDifferentGradients__1.xml index 5ebaedd..7c8d73a 100644 --- a/test/Integration/__snapshots__/SVGRenderingTest__testQrWithGradientGeneratesDifferentIdsForDifferentGradients__1.xml +++ b/test/Integration/__snapshots__/SVGRenderingTest__testQrWithGradientGeneratesDifferentIdsForDifferentGradients__1.xml @@ -2,7 +2,7 @@ - + diff --git a/test/Integration/__snapshots__/SVGRenderingTest__testQrWithGradientGeneratesDifferentIdsForDifferentGradients__2.xml b/test/Integration/__snapshots__/SVGRenderingTest__testQrWithGradientGeneratesDifferentIdsForDifferentGradients__2.xml index 466151f..997c9de 100644 --- a/test/Integration/__snapshots__/SVGRenderingTest__testQrWithGradientGeneratesDifferentIdsForDifferentGradients__2.xml +++ b/test/Integration/__snapshots__/SVGRenderingTest__testQrWithGradientGeneratesDifferentIdsForDifferentGradients__2.xml @@ -2,7 +2,7 @@ - +