Update parser.js

Better than getting 0px width and height.
Specs say that when they are missing we should consider 100%, in our case 100% will be 100px because we don't have anything to compare the SVG to before adding the SVG into a canvas.
Otherwise we could take canvas widht and height.
This commit is contained in:
Andrea Bogazzi 2014-08-27 14:17:33 +02:00
parent 959bdcfdf4
commit cd7bea6183

View file

@ -510,8 +510,8 @@
parseUseDirectives(doc);
var viewBoxAttr = doc.getAttribute('viewBox'),
widthAttr = parseUnit(doc.getAttribute('width')),
heightAttr = parseUnit(doc.getAttribute('height')),
widthAttr = parseUnit(doc.getAttribute('width') || '100%'),
heightAttr = parseUnit(doc.getAttribute('height') || '100%'),
viewBoxWidth,
viewBoxHeight;