Skip to content

Commit

Permalink
temporary workaround for alien SVGElement in Chrome
Browse files Browse the repository at this point in the history
When using this fix, the call site must ensure availability of
getComputedStyle, and pass in a compatible SVGElement instance.

for background, see:
alafr#47 (comment)
  • Loading branch information
jokester committed Sep 13, 2017
1 parent d978ab6 commit a8eb57d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source.js
Expand Up @@ -2186,7 +2186,7 @@ var SVGtoPDF = function(doc, svg, x, y, options) {
viewportWidth = (options.width || doc.page.width) / pxToPt,
viewportHeight = (options.height || doc.page.height) / pxToPt,
preserveAspectRatio = options.preserveAspectRatio || null, // default to null so that the attr can override if not passed
useCSS = options.useCSS && typeof SVGElement !== 'undefined' && svg instanceof SVGElement && typeof getComputedStyle === 'function',
useCSS = options.useCSS,
warningCallback = options.warningCallback,
fontCallback = options.fontCallback,
imageCallback = options.imageCallback,
Expand Down

0 comments on commit a8eb57d

Please sign in to comment.