NanoSVG: parse 'class' attribute before 'style'.

(cherry picked from commit 64a64f5216)
This commit is contained in:
Alex Shvartzkop 2023-10-09 05:51:36 +03:00
parent 14f12ccf51
commit e55989120e
1 changed files with 17 additions and 5 deletions

View File

@ -2667,18 +2667,30 @@ static void nsvg__parsePath( NSVGparser* p, const char** attr )
int i;
char item[64];
for( i = 0; attr[i]; i += 2 )
{
if( strcmp( attr[i], "class" ) == 0 )
{
tmp[0] = attr[i];
tmp[1] = attr[i + 1];
tmp[2] = 0;
tmp[3] = 0;
nsvg__parseAttribs( p, tmp );
}
}
for( i = 0; attr[i]; i += 2 )
{
if( strcmp( attr[i], "d" ) == 0 )
{
s = attr[i + 1];
}
else
else if( strcmp( attr[i], "class" ) != 0 )
{
tmp[0] = attr[i];
tmp[1] = attr[i + 1];
tmp[2] = 0;
tmp[3] = 0;
tmp[0] = attr[i];
tmp[1] = attr[i + 1];
tmp[2] = 0;
tmp[3] = 0;
nsvg__parseAttribs( p, tmp );
}
}