From 6da9de573978d5a05b7048dbdc642a7a648d38bc Mon Sep 17 00:00:00 2001 From: Jiri Drbalek Date: Wed, 24 Aug 2016 11:15:32 +0000 Subject: [PATCH] fix closing segment --- .../renderer_common/process_building_symbolizer.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/mapnik/renderer_common/process_building_symbolizer.hpp b/include/mapnik/renderer_common/process_building_symbolizer.hpp index 6b0a94f79..a9c88436b 100644 --- a/include/mapnik/renderer_common/process_building_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_building_symbolizer.hpp @@ -41,6 +41,7 @@ void make_building(geometry::polygon const& poly, double height, F1 cons const std::unique_ptr frame(new path_type(path_type::types::LineString)); const std::unique_ptr roof(new path_type(path_type::types::Polygon)); std::deque face_segments; + double ring_begin_x, ring_begin_y; double x0 = 0; double y0 = 0; double x,y; @@ -52,15 +53,21 @@ void make_building(geometry::polygon const& poly, double height, F1 cons if (cm == SEG_MOVETO) { frame->move_to(x,y); + ring_begin_x = x; + ring_begin_y = y; } else if (cm == SEG_LINETO) { frame->line_to(x,y); - face_segments.push_back(segment_t(x0,y0,x,y)); + face_segments.emplace_back(x0,y0,x,y); } else if (cm == SEG_CLOSE) { frame->close_path(); + if (!face_segments.empty()) + { + face_segments.emplace_back(x0, y0, ring_begin_x, ring_begin_y); + } } x0 = x; y0 = y;