Skip to content

Commit

Permalink
Adding viewBox attribut to SVG
Browse files Browse the repository at this point in the history
Adding viewBox attribute to SVG renderer makes the final image easily scaleable by CSS.
  • Loading branch information
iben12 committed Oct 24, 2014
1 parent 0537ed2 commit f44e4de
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/BaconQrCode/Renderer/Image/Svg.php
Expand Up @@ -54,6 +54,7 @@ public function init()
$this->svg->addAttribute('version', '1.1');
$this->svg->addAttribute('width', $this->finalWidth . 'px');
$this->svg->addAttribute('height', $this->finalHeight . 'px');
$this->svg->addAttribute('viewBox', '0 0 ' . $this->finalWidth . ' ' . $this->finalHeight);
$this->svg->addChild('defs');
}

Expand Down

0 comments on commit f44e4de

Please sign in to comment.