mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Prevent double-application of styles when importing #document SVG nodes.
Closes #509.
This commit is contained in:
parent
53b00b40e1
commit
4e9fc558ac
1 changed files with 3 additions and 2 deletions
|
@ -595,8 +595,9 @@ new function() {
|
||||||
item = importer && importer(node, type, options, isRoot) || null;
|
item = importer && importer(node, type, options, isRoot) || null;
|
||||||
settings.applyMatrix = prevApplyMatrix;
|
settings.applyMatrix = prevApplyMatrix;
|
||||||
if (item) {
|
if (item) {
|
||||||
// See importGroup() for an explanation of this filtering:
|
// Do not apply attributes if this is a #document node.
|
||||||
if (!(item instanceof Group))
|
// See importGroup() for an explanation of filtering for Group:
|
||||||
|
if (type !== '#document' && !(item instanceof Group))
|
||||||
item = applyAttributes(item, node, isRoot);
|
item = applyAttributes(item, node, isRoot);
|
||||||
// Support onImportItem callback, to provide mechanism to handle
|
// Support onImportItem callback, to provide mechanism to handle
|
||||||
// special attributes (e.g. inkscape:transform-center)
|
// special attributes (e.g. inkscape:transform-center)
|
||||||
|
|
Loading…
Reference in a new issue