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

This commit is contained in:
Alex Shvartzkop 2023-10-09 05:51:36 +03:00
parent c9d6e79d2d
commit 64a64f5216
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; int i;
char item[64]; 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 ) for( i = 0; attr[i]; i += 2 )
{ {
if( strcmp( attr[i], "d" ) == 0 ) if( strcmp( attr[i], "d" ) == 0 )
{ {
s = attr[i + 1]; s = attr[i + 1];
} }
else else if( strcmp( attr[i], "class" ) != 0 )
{ {
tmp[0] = attr[i]; tmp[0] = attr[i];
tmp[1] = attr[i + 1]; tmp[1] = attr[i + 1];
tmp[2] = 0; tmp[2] = 0;
tmp[3] = 0; tmp[3] = 0;
nsvg__parseAttribs( p, tmp ); nsvg__parseAttribs( p, tmp );
} }
} }