svg_loader: fixing finding defs node

In the case when a 'use' node was used
in a 'defs' block  and the element it
referenced was also defined within the same
'defs' block, the reference node could not
be cloned. This was because the 'defs' node
could not be located.

@Issue: https://github.com/thorvg/thorvg/issues/1451
This commit is contained in:
Mira Grudzinska 2023-05-16 01:23:09 +02:00 committed by Hermet Park
parent 40ef9031ba
commit 2cfa5505c3

View file

@ -1903,6 +1903,7 @@ static SvgNode* _getDefsNode(SvgNode* node)
}
if (node->type == SvgNodeType::Doc) return node->node.doc.defs;
if (node->type == SvgNodeType::Defs) return node;
return nullptr;
}