mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 21:53:41 +00:00
loader SvgLoader: Fix wrong debug log
1. Modify that attribute information used for use type looks like it was used for g type. 2. Fix clippath node looking like setting "none" (clippath's display = false is intentional)
This commit is contained in:
parent
8b54b6768a
commit
51e4757a3b
2 changed files with 4 additions and 4 deletions
|
@ -1879,7 +1879,7 @@ static bool _attrParseUseNode(void* data, const char* key, const char* value)
|
||||||
|
|
||||||
static SvgNode* _createUseNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength)
|
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;
|
if (!loader->svgParse->node) return nullptr;
|
||||||
|
|
||||||
|
@ -2502,7 +2502,7 @@ static void _styleInherit(SvgStyleProperty* child, const SvgStyleProperty* paren
|
||||||
|
|
||||||
#ifdef THORVG_LOG_ENABLED
|
#ifdef THORVG_LOG_ENABLED
|
||||||
static void _inefficientNodeCheck(SvgNode* node){
|
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->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());
|
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());
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ static bool _appendShape(SvgNode* node, Shape* shape, float vx, float vy, float
|
||||||
|
|
||||||
static inline bool _isGroupType(SvgNodeType type)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ static void _applyProperty(SvgNode* node, Shape* vg, float vx, float vy, float v
|
||||||
//Apply node opacity
|
//Apply node opacity
|
||||||
if (style->opacity < 255) vg->opacity(style->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
|
//Apply the stroke style property
|
||||||
vg->stroke(style->stroke.width);
|
vg->stroke(style->stroke.width);
|
||||||
|
|
Loading…
Add table
Reference in a new issue