From 0feabeb7e8c6a86b3c7e55ee8b31e165f7f6c481 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Tue, 13 Apr 2021 13:48:05 +0100 Subject: [PATCH] SVG circle: ignore when r = 0 --- src/svg/svg_parser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index 4df44ff9e..f8b96b355 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -1168,8 +1168,7 @@ void parse_circle(svg_parser & parser, rapidxml::xml_node const* node) if (percent && parser.vbox_) r *= parser.normalized_diagonal_; } - parser.path_.begin_path(); - if(r != 0.0) + if (r != 0.0) { if (r < 0.0) { @@ -1179,11 +1178,12 @@ void parse_circle(svg_parser & parser, rapidxml::xml_node const* node) } else { + parser.path_.begin_path(); agg::ellipse c(cx, cy, r, r); parser.path_.storage().concat_path(c); + parser.path_.end_path(); } } - parser.path_.end_path(); } void parse_ellipse(svg_parser & parser, rapidxml::xml_node const * node)