SVG parse_svg_value: restore val and is_percent to default values on parsing failure
This commit is contained in:
parent
1568fa3894
commit
d70f207577
1 changed files with 2 additions and 1 deletions
|
@ -275,7 +275,8 @@ double parse_svg_value(T & err_handler, const char* str, bool & is_percent)
|
||||||
x3::lit('%')[apply_percent]),
|
x3::lit('%')[apply_percent]),
|
||||||
x3::space) || (cur != end))
|
x3::space) || (cur != end))
|
||||||
{
|
{
|
||||||
val = 0.0;
|
val = 0.0; // restore default value on parsing failure
|
||||||
|
is_percent = true; // viewport/viewBox logic expects default value to be `true` on failure
|
||||||
err_handler.on_error("SVG parse error: failed to parse <number> with value \"" + std::string(str) + "\"");
|
err_handler.on_error("SVG parse error: failed to parse <number> with value \"" + std::string(str) + "\"");
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
|
|
Loading…
Reference in a new issue