File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ var svg_string = qr.imageSync('I love QR!', { type: 'svg' });
4545 * ` options ` — image options object:
4646 * ` ec_level ` — default ` M ` .
4747 * ` type ` — image type. Possible values ` png ` (default), ` svg ` , ` pdf ` and ` eps ` .
48- * ` size ` (png and svg only) — size of one module in pixels. Default ` 5 ` for png and ` 1 ` for others .
48+ * ` size ` (png and svg only) — size of one module in pixels. Default ` 5 ` for png and ` undefined ` for svg .
4949 * ` margin ` — white space around QR image in modules. Default ` 4 ` for ` png ` and ` 1 ` for others.
5050 * ` customize ` (only png) — function to customize qr bitmap before encoding to PNG.
5151 * ` parse_url ` (experimental, default ` false ` ) — try to optimize QR-code for URLs.
Original file line number Diff line number Diff line change @@ -149,9 +149,11 @@ function SVG_object(matrix, margin) {
149149
150150function SVG ( matrix , stream , margin , size ) {
151151 var X = matrix . length + 2 * margin ;
152- var XY = X * size ;
153152 stream . push ( '<svg xmlns="http://www.w3.org/2000/svg" ' ) ;
154- if ( size >= 0 ) stream . push ( 'width="' + XY + '" height="' + XY + '" ' ) ;
153+ if ( size > 0 ) {
154+ var XY = X * size ;
155+ stream . push ( 'width="' + XY + '" height="' + XY + '" ' ) ;
156+ }
155157 stream . push ( 'viewBox="0 0 ' + X + ' ' + X + '">' ) ;
156158 stream . push ( '<path d="' ) ;
157159 pushSVGPath ( matrix , stream , margin ) ;
You can’t perform that action at this time.
0 commit comments