diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index 9cc18f39d..020e50552 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -275,7 +275,8 @@ double parse_svg_value(T & err_handler, const char* str, bool & is_percent) x3::lit('%')[apply_percent]), 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 with value \"" + std::string(str) + "\""); } return val;