loaders svg: ++ log info for wrong situation.

if either log is printed, we need to improve the composition method.
This commit is contained in:
Hermet Park 2021-04-09 11:02:35 +09:00
parent 605a3bf175
commit adf1312a5e

View file

@ -858,6 +858,9 @@ static void _handleTransformAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node
static void _handleClipPathAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
{
SvgStyleProperty* style = node->style;
#ifdef THORVG_LOG_ENABLED
if (style->comp.method != CompositeMethod::None) printf("SVG: Multiple Composition Tried!\n");
#endif
style->comp.method = CompositeMethod::ClipPath;
int len = strlen(value);
if (len >= 3 && !strncmp(value, "url", 3)) style->comp.url = _idFromUrl((const char*)(value + 3));
@ -866,6 +869,9 @@ static void _handleClipPathAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node,
static void _handleMaskAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
{
SvgStyleProperty* style = node->style;
#ifdef THORVG_LOG_ENABLED
if (style->comp.method != CompositeMethod::None) printf("SVG: Multiple Composition Tried!\n");
#endif
style->comp.method = CompositeMethod::AlphaMask;
int len = strlen(value);
if (len >= 3 && !strncmp(value, "url", 3)) style->comp.url = _idFromUrl((const char*)(value + 3));