Skip to content

Commit

Permalink
Merge pull request #39 from vflyson/patch-1
Browse files Browse the repository at this point in the history
Scalable SVGs and white background
  • Loading branch information
kazuhikoarase authored Jul 24, 2017
2 parents e69a9e0 + 6b126fa commit c986449
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/qrcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,12 @@ var qrcode = function() {
rect = 'l' + cellSize + ',0 0,' + cellSize +
' -' + cellSize + ',0 0,-' + cellSize + 'z ';

qrSvg += '<svg';
qrSvg += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"';
qrSvg += ' width="' + size + 'px"';
qrSvg += ' height="' + size + 'px"';
qrSvg += ' xmlns="http://www.w3.org/2000/svg"';
qrSvg += '>';
qrSvg += ' viewBox="0 0 ' + size + ' ' + size + '" ';
qrSvg += ' preserveAspectRatio="xMinYMin meet">';
qrSvg += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>';
qrSvg += '<path d="';

for (r = 0; r < _this.getModuleCount(); r += 1) {
Expand Down

0 comments on commit c986449

Please sign in to comment.