فهرست منبع

:octocat: remove QROptionsTrait::$svgWidth and QROptionsTrait::$svgHeight as they can now be easily set in QRMarkupSVG::header() if necessary

smiley 2 سال پیش
والد
کامیت
527b67ab7a
3فایلهای تغییر یافته به همراه1 افزوده شده و 22 حذف شده
  1. 0 2
      docs/Built-In-Output-QRMarkupSVG.md
  2. 1 6
      src/Output/QRMarkupSVG.php
  3. 0 14
      src/QROptionsTrait.php

+ 0 - 2
docs/Built-In-Output-QRMarkupSVG.md

@@ -87,11 +87,9 @@ printf('<img alt="%s" src="%s" />', $alt, $out);
 | `$outputBase64`           | `bool`         |
 | `$svgAddXmlHeader`        | `bool`         |
 | `$svgDefs`                | `string`       |
-| `$svgHeight`              | `string\|null` |
 | `$svgOpacity`             | `float`        |
 | `$svgPreserveAspectRatio` | `string`       |
 | `$svgViewBoxSize`         | `int\|null`    |
-| `$svgWidth`               | `string\|null` |
 
 
 ### Options that have no effect

+ 1 - 6
src/Output/QRMarkupSVG.php

@@ -73,17 +73,12 @@ class QRMarkupSVG extends QRMarkup{
 	 * returns the <svg> header with the given options parsed
 	 */
 	protected function header():string{
-		$width  = ($this->options->svgWidth !== null) ? sprintf(' width="%s"', $this->options->svgWidth) : '';
-		$height = ($this->options->svgHeight !== null) ? sprintf(' height="%s"', $this->options->svgHeight) : '';
 
-		/** @noinspection HtmlUnknownAttribute */
 		$header = sprintf(
-			'<svg xmlns="http://www.w3.org/2000/svg" class="qr-svg %1$s" viewBox="0 0 %2$s %2$s" preserveAspectRatio="%3$s"%4$s%5$s>%6$s',
+			'<svg xmlns="http://www.w3.org/2000/svg" class="qr-svg %1$s" viewBox="%2$s" preserveAspectRatio="%3$s">%4$s',
 			$this->options->cssClass,
 			($this->options->svgViewBoxSize ?? $this->moduleCount),
 			$this->options->svgPreserveAspectRatio,
-			$width,
-			$height,
 			$this->options->eol
 		);
 

+ 0 - 14
src/QROptionsTrait.php

@@ -351,20 +351,6 @@ trait QROptionsTrait{
 	 */
 	protected string $svgPreserveAspectRatio = 'xMidYMid';
 
-	/**
-	 * Optional "width" attribute with the specified value (note that the value is not checked!)
-	 *
-	 * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/width
-	 */
-	protected ?string $svgWidth = null;
-
-	/**
-	 * Optional "height" attribute with the specified value (note that the value is not checked!)
-	 *
-	 * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/height
-	 */
-	protected ?string $svgHeight = null;
-
 
 	/*
 	 * QRString settings