svg_loader: fixing color parsing

Color given in percentages, ex."rgb(10%,20%,30%)", was incorrectly parsed.
This commit is contained in:
mgrudzinska 2022-04-04 00:02:43 +02:00 committed by Hermet Park
parent 470b885e65
commit eb7b281898

View file

@ -337,7 +337,10 @@ static unsigned char _parserColor(const char* value, char** end)
r = svgUtilStrtof(value, end);
*end = _skipSpace(*end, nullptr);
if (**end == '%') r = 255 * r / 100;
if (**end == '%') {
r = 255 * r / 100;
(*end)++;
}
*end = _skipSpace(*end, nullptr);
if (r < 0 || r > 255) {