mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
svg_loader: removed unused code
While css styling applied one of conditions was always false. It is now removed and the function that was called is refactored
This commit is contained in:
parent
83ffe9f612
commit
bf2b348343
1 changed files with 2 additions and 5 deletions
|
@ -155,12 +155,12 @@ SvgNode* cssFindStyleNode(const SvgNode* style, const char* title, SvgNodeType t
|
||||||
|
|
||||||
SvgNode* cssFindStyleNode(const SvgNode* style, const char* title)
|
SvgNode* cssFindStyleNode(const SvgNode* style, const char* title)
|
||||||
{
|
{
|
||||||
if (!style) return nullptr;
|
if (!style || !title) return nullptr;
|
||||||
|
|
||||||
auto child = style->child.data;
|
auto child = style->child.data;
|
||||||
for (uint32_t i = 0; i < style->child.count; ++i, ++child) {
|
for (uint32_t i = 0; i < style->child.count; ++i, ++child) {
|
||||||
if ((*child)->type == SvgNodeType::CssStyle) {
|
if ((*child)->type == SvgNodeType::CssStyle) {
|
||||||
if ((title && (*child)->id && !strcmp((*child)->id, title))) return (*child);
|
if ((*child)->id && !strcmp((*child)->id, title)) return (*child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -175,9 +175,6 @@ void cssUpdateStyle(SvgNode* doc, SvgNode* style)
|
||||||
if (auto cssNode = cssFindStyleNode(style, nullptr, (*child)->type)) {
|
if (auto cssNode = cssFindStyleNode(style, nullptr, (*child)->type)) {
|
||||||
cssCopyStyleAttr(*child, cssNode);
|
cssCopyStyleAttr(*child, cssNode);
|
||||||
}
|
}
|
||||||
if (auto cssNode = cssFindStyleNode(style, nullptr)) {
|
|
||||||
cssCopyStyleAttr(*child, cssNode);
|
|
||||||
}
|
|
||||||
cssUpdateStyle(*child, style);
|
cssUpdateStyle(*child, style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue