mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 21:53:41 +00:00
SvgLoader: Defs type nodes are not saved in loader's node list.
If there is an empty (unused) <defs /> inside the svg file, this can cause problems. <defs> node is managed separately in loader->def. So it doesn't have to be added to loader's list.
This commit is contained in:
parent
ff96d4bf2b
commit
7aff026276
1 changed files with 3 additions and 2 deletions
|
@ -1955,11 +1955,12 @@ static void _svgLoaderParserXmlOpen(SvgLoaderData* loader, const char* content,
|
||||||
if (loader->stack.cnt > 0) parent = loader->stack.list[loader->stack.cnt - 1];
|
if (loader->stack.cnt > 0) parent = loader->stack.list[loader->stack.cnt - 1];
|
||||||
node = method(loader, parent, attrs, attrsLength);
|
node = method(loader, parent, attrs, attrsLength);
|
||||||
}
|
}
|
||||||
loader->stack.push(node);
|
|
||||||
|
|
||||||
if (node->type == SvgNodeType::Defs) {
|
if (node->type == SvgNodeType::Defs) {
|
||||||
loader->doc->node.doc.defs = node;
|
loader->doc->node.doc.defs = node;
|
||||||
loader->def = node;
|
loader->def = node;
|
||||||
|
} else {
|
||||||
|
loader->stack.push(node);
|
||||||
}
|
}
|
||||||
} else if ((method = _findGraphicsFactory(tagName))) {
|
} else if ((method = _findGraphicsFactory(tagName))) {
|
||||||
parent = loader->stack.list[loader->stack.cnt - 1];
|
parent = loader->stack.list[loader->stack.cnt - 1];
|
||||||
|
|
Loading…
Add table
Reference in a new issue