static SvgNode* _createUseNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength)
{
- loader->svgParse->node = _createNode(parent, SvgNodeType::G);
+ loader->svgParse->node = _createNode(parent, SvgNodeType::Use);
if (!loader->svgParse->node) return nullptr;
#ifdef THORVG_LOG_ENABLED
static void _inefficientNodeCheck(SvgNode* node){
- if (!node->display) printf("SVG: Inefficient elements used [Display is none][Node Type : %s]\n", simpleXmlNodeTypeToString(node->type).c_str());
+ if (!node->display && node->type != SvgNodeType:ClipPath) printf("SVG: Inefficient elements used [Display is none][Node Type : %s]\n", simpleXmlNodeTypeToString(node->type).c_str());
if (node->style->opacity == 0) printf("SVG: Inefficient elements used [Opacity is zero][Node Type : %s]\n", simpleXmlNodeTypeToString(node->type).c_str());
if (node->style->fill.opacity == 0 && node->style->stroke.opacity == 0) printf("SVG: Inefficient elements used [Fill opacity and stroke opacity are zero][Node Type : %s]\n", simpleXmlNodeTypeToString(node->type).c_str());
static inline bool _isGroupType(SvgNodeType type)
{
- if (type == SvgNodeType::Doc || type == SvgNodeType::G || type == SvgNodeType::ClipPath) return true;
+ if (type == SvgNodeType::Doc || type == SvgNodeType::G || type == SvgNodeType::Use || type == SvgNodeType::ClipPath) return true;
return false;
}
//Apply node opacity
if (style->opacity < 255) vg->opacity(style->opacity);
- if (node->type == SvgNodeType::G) return;
+ if (node->type == SvgNodeType::G || node->type == SvgNodeType::Use) return;
//Apply the stroke style property
vg->stroke(style->stroke.width);