mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-27 00:26:51 +00:00
svg_loader: fix dead loop on none digit char in stroke-dasharray
This commit is contained in:
parent
a40d3f6fd7
commit
2f8c00580d
1 changed files with 8 additions and 3 deletions
|
@ -250,10 +250,15 @@ _parseDashArray(const char *str, SvgDash* dash)
|
|||
|
||||
char *end = nullptr;
|
||||
|
||||
while (*str) {
|
||||
// skip white space, comma
|
||||
str = _skipComma(str);
|
||||
(*dash).array.push(svgUtilStrtof(str, &end));
|
||||
while (*str) {
|
||||
float parsedValue = svgUtilStrtof(str, &end);
|
||||
if (str == end) break;
|
||||
if (*end == '%') {
|
||||
++end;
|
||||
//TODO: multiply percentage value
|
||||
}
|
||||
(*dash).array.push(parsedValue);
|
||||
str = _skipComma(end);
|
||||
}
|
||||
//If dash array size is 1, it means that dash and gap size are the same.
|
||||
|
|
Loading…
Add table
Reference in a new issue