mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
svg_loader: fixing color parsing
Color given in percentages, ex."rgb(10%,20%,30%)", was incorrectly parsed.
This commit is contained in:
parent
470b885e65
commit
eb7b281898
1 changed files with 4 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue