mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 20:44:52 +00:00
SvgLoader: Fix missing doc.gradients update
When both <defs> and <svg> gradients are declared, the update of gradient declared in <svg> is omitted. Therefore, this patch fixes any missing gradient updates.
This commit is contained in:
parent
eb64428bde
commit
1280548cf1
1 changed files with 2 additions and 5 deletions
|
@ -2355,11 +2355,8 @@ void SvgLoader::run()
|
||||||
_updateStyle(loaderData.doc, nullptr);
|
_updateStyle(loaderData.doc, nullptr);
|
||||||
auto defs = loaderData.doc->node.doc.defs;
|
auto defs = loaderData.doc->node.doc.defs;
|
||||||
if (defs) _updateGradient(loaderData.doc, &defs->node.defs.gradients);
|
if (defs) _updateGradient(loaderData.doc, &defs->node.defs.gradients);
|
||||||
else {
|
|
||||||
if (loaderData.gradients.cnt > 0) {
|
if (loaderData.gradients.cnt > 0) _updateGradient(loaderData.doc, &loaderData.gradients);
|
||||||
_updateGradient(loaderData.doc, &loaderData.gradients);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
root = builder.build(loaderData.doc);
|
root = builder.build(loaderData.doc);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue