diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index c67cf4466..853438fd3 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -500,117 +500,102 @@ void traverse_tree(svg_parser& parser, rapidxml::xml_node const* node) switch (node->type()) { - case rapidxml::node_element: { - parser.font_sizes_.push_back(parser.font_sizes_.back()); - switch (name) + case rapidxml::node_element: + parser.font_sizes_.push_back(parser.font_sizes_.back()); + switch (name) + { + case "defs"_case: { + if (node->first_node() != nullptr) { - case "defs"_case: { - if (node->first_node() != nullptr) - { - parser.is_defs_ = true; - } - break; - } - case "clipPath"_case: - case "symbol"_case: - case "pattern"_case: { - parser.ignore_ = true; - break; - } - // the gradient tags *should* be in defs, but illustrator seems not to put them in there so - // accept them anywhere - case "linearGradient"_case: - parse_linear_gradient(parser, node); - break; - case "radialGradient"_case: - parse_radial_gradient(parser, node); - break; + parser.is_defs_ = true; } - - if (!parser.is_defs_) // FIXME - { - switch (name) - { - case "g"_case: - if (node->first_node() != nullptr) - { - parser.path_.push_attr(); - parse_id(parser, node); - if (parser.css_style_) - process_css(parser, node); - parse_attr(parser, node); - parser.path_.begin_group(); - } - break; - case "use"_case: - parser.path_.push_attr(); - parse_id(parser, node); - if (parser.css_style_) - process_css(parser, node); - parse_attr(parser, node); - if (parser.path_.cur_attr().opacity < 1.0) - parser.path_.begin_group(); - parse_use(parser, node); - if (parser.path_.cur_attr().opacity < 1.0) - parser.path_.end_group(); - parser.path_.pop_attr(); - break; - default: - parser.path_.push_attr(); - parse_id(parser, node); - if (parser.css_style_) - process_css(parser, node); - parse_attr(parser, node); - if (parser.path_.display()) - { - if (parser.path_.cur_attr().opacity < 1.0) - parser.path_.begin_group(); - parse_element(parser, node->name(), node); - if (parser.path_.cur_attr().opacity < 1.0) - parser.path_.end_group(); - } - parser.path_.pop_attr(); - } - } - else - { - // save node for later - parse_id(parser, node); - } - - if ("style"_case == name) - { - //