diff --git a/include/mapnik/svg/svg_path_grammar_x3_def.hpp b/include/mapnik/svg/svg_path_grammar_x3_def.hpp index 25ddf6745..89fcffb7d 100644 --- a/include/mapnik/svg/svg_path_grammar_x3_def.hpp +++ b/include/mapnik/svg/svg_path_grammar_x3_def.hpp @@ -121,8 +121,8 @@ auto const arc_to = [] (auto & ctx) auto const& attr = _attr(ctx); auto const& p = boost::fusion::at_c<0>(attr); double angle = boost::fusion::at_c<1>(attr); - int large_arc_flag = (boost::fusion::at_c<2>(attr) == '1')? 1 : 0; - int sweep_flag = (boost::fusion::at_c<3>(attr) == '1')? 1 : 0; + bool large_arc_flag = boost::fusion::at_c<2>(attr); + bool sweep_flag = boost::fusion::at_c<3>(attr); auto const& v = boost::fusion::at_c<4>(attr); extract_path(ctx).arc_to(std::get<0>(p), std::get<1>(p), util::radians(angle), @@ -146,6 +146,8 @@ auto const absolute = [] (auto const& ctx) extract_relative(ctx) = false; }; +// arc flags parser 0/1 +x3::uint_parser flag; // rules auto const coord = x3::rule{} = double_ > -lit(',') > double_; @@ -176,8 +178,6 @@ auto const Q = x3::rule {} = (lit('Q')[absolute] | lit('q')[relativ auto const T = x3::rule {} = (lit('T')[absolute] | lit('t')[relative]) > ((coord ) [curve3_smooth] % -lit(',')); // +curve3_smooth (smooth-quadratic-bezier-curveto) -auto const flag = x3::rule {} = char_('0') | char_('1'); // arc-flag/sweep-flag - auto const A = x3::rule {} = (lit('A')[absolute] | lit('a')[relative]) > ((coord > -lit(',') > double_ > -lit(',') > flag > -lit(',') > flag > -lit(',') > coord) [arc_to] % -lit(',')); // +arc_to;