From e213f49d7cb7bdba4fbbc2e2cbdbfafbdc7722d5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 27 Jul 2012 19:21:46 -0700 Subject: [PATCH] re-implement conditional stroke application in markers_symbolizer initially added in 9d756165e01, amended in 9f064960e360, and wrongly disabled in bd74d18f6d648dd3f4b197000f79c6490474b296 --- src/load_map.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/load_map.cpp b/src/load_map.cpp index da47c6640..7349d0f8e 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -111,7 +111,7 @@ private: void parse_markers_symbolizer(rule & rule, xml_node const& sym); void parse_raster_colorizer(raster_colorizer_ptr const& rc, xml_node const& node); - void parse_stroke(stroke & strk, xml_node const & sym); + bool parse_stroke(stroke & strk, xml_node const & sym); void ensure_font_face(std::string const& face_name); void find_unused_nodes(xml_node const& root); @@ -1055,8 +1055,10 @@ void map_parser::parse_markers_symbolizer(rule & rule, xml_node const& node) if (height) sym.set_height(*height); stroke strk; - parse_stroke(strk,node); - sym.set_stroke(strk); + if (parse_stroke(strk,node)) + { + sym.set_stroke(strk); + } marker_placement_e placement = node.get_attr("placement", MARKER_POINT_PLACEMENT); sym.set_marker_placement(placement); @@ -1300,12 +1302,15 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& sym) } } -void map_parser::parse_stroke(stroke & strk, xml_node const & sym) +bool map_parser::parse_stroke(stroke & strk, xml_node const & sym) { + bool result = false; + // stroke color optional c = sym.get_opt_attr("stroke"); if (c) { + result = true; strk.set_color(*c); } @@ -1313,12 +1318,17 @@ void map_parser::parse_stroke(stroke & strk, xml_node const & sym) optional width = sym.get_opt_attr("stroke-width"); if (width) { + result = true; strk.set_width(*width); } // stroke-opacity optional opacity = sym.get_opt_attr("stroke-opacity"); - if (opacity) strk.set_opacity(*opacity); + if (opacity) + { + result = true; + strk.set_opacity(*opacity); + } // stroke-linejoin optional line_join = sym.get_opt_attr("stroke-linejoin"); @@ -1373,6 +1383,7 @@ void map_parser::parse_stroke(stroke & strk, xml_node const & sym) // stroke-miterlimit optional miterlimit = sym.get_opt_attr("stroke-miterlimit"); if (miterlimit) strk.set_miterlimit(*miterlimit); + return result; } void map_parser::parse_line_symbolizer(rule & rule, xml_node const & sym)