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

This commit is contained in:
smiley
2023-09-17 16:31:27 +02:00
parent 50701f94fd
commit 527b67ab7a
3 changed files with 1 additions and 22 deletions
-2
View File
@@ -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
View File
@@ -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
);
-14
View File
@@ -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