From 4e9fc558ac6f87962e932170d5e14955f74df637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 16 Aug 2014 17:31:42 +0200 Subject: [PATCH] Prevent double-application of styles when importing #document SVG nodes. Closes #509. --- src/svg/SVGImport.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index ef87c488..0418c0c6 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -595,8 +595,9 @@ new function() { item = importer && importer(node, type, options, isRoot) || null; settings.applyMatrix = prevApplyMatrix; if (item) { - // See importGroup() for an explanation of this filtering: - if (!(item instanceof Group)) + // Do not apply attributes if this is a #document node. + // See importGroup() for an explanation of filtering for Group: + if (type !== '#document' && !(item instanceof Group)) item = applyAttributes(item, node, isRoot); // Support onImportItem callback, to provide mechanism to handle // special attributes (e.g. inkscape:transform-center)