diff --git a/include/mapnik/geometry_to_path.hpp b/include/mapnik/geometry_to_path.hpp index f74fabc5f..dcd62ecc4 100644 --- a/include/mapnik/geometry_to_path.hpp +++ b/include/mapnik/geometry_to_path.hpp @@ -75,24 +75,38 @@ struct geometry_to_path bool first = true; for (auto const& pt : poly.exterior_ring) { - //point pt_new; - //Transformer::apply(pt, pt_new); - if (first) { p_.move_to(pt.x, pt.y); first=false;} - else p_.line_to(pt.x, pt.y); + if (first) { + p_.move_to(pt.x, pt.y); + first=false; + } + else + { + p_.line_to(pt.x, pt.y); + } + } + if (!first) + { + p_.close_path(); } - p_.close_path(); // interior for (auto const& ring : poly.interior_rings) { first = true; for (auto const& pt : ring) { - //point pt_new; - //Transformer::apply(pt, pt_new); - if (first) { p_.move_to(pt.x, pt.y); first=false;} - else p_.line_to(pt.x, pt.y); + if (first) { + p_.move_to(pt.x, pt.y); + first=false; + } + else + { + p_.line_to(pt.x, pt.y); + } + } + if (!first) + { + p_.close_path(); } - p_.close_path(); } }