[dissolve][test] enhance debug information by showing positive/negative rings

This commit is contained in:
Barend Gehrels 2018-01-12 16:29:17 +01:00
parent 4902e1ef25
commit 29bb764bfc

View File

@ -241,8 +241,11 @@ struct map_visitor
typedef typename boost::range_value<Rings>::type ring_type;
BOOST_FOREACH(ring_type const& ring, rings)
{
m_mapper.map(ring, "fill-opacity:0.1;fill:rgb(0,0,255);"
"stroke:rgb(0,0,255);stroke-width:0.1");
double const area = bg::area(ring);
std::string const color = area < 0 ? "rgb(255,0,0)" : "rgb(0,0,255)";
std::string const style = "stroke:" + color
+ ";stroke-width:0.1;fill-opacity:0.1;fill:" + color;
m_mapper.map(ring, style);
}
}