Prevent double-application of styles when importing #document SVG nodes.

Closes #509.
This commit is contained in:
Jürg Lehni 2014-08-16 17:31:42 +02:00
parent 53b00b40e1
commit 4e9fc558ac

View file

@ -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)