[overlay] fix bug where self-turn was not startable, and therefore an

interior ring was missing
This commit is contained in:
Barend Gehrels
2017-07-31 12:14:40 +02:00
parent 664c1aa10a
commit 56b5d7bf8a

View File

@@ -751,7 +751,9 @@ inline void gather_cluster_properties(Clusters& clusters, Turns& turns,
cinfo.open_count = sbs.open_count(for_operation);
// Unset the startable flag for all 'closed' zones
// Unset the startable flag for all 'closed' zones. This does not
// apply for self-turns, because those counts are not from both
// polygons
for (std::size_t i = 0; i < sbs.m_ranked_points.size(); i++)
{
const typename sbs_type::rp& ranked = sbs.m_ranked_points[i];
@@ -773,6 +775,13 @@ inline void gather_cluster_properties(Clusters& clusters, Turns& turns,
op.enriched.rank = ranked.rank;
op.enriched.zone = ranked.zone;
if (OverlayType != overlay_difference
&& is_self_turn<OverlayType>(turn))
{
// Difference needs the self-turns, TODO: investigate
continue;
}
if ((for_operation == operation_union
&& ranked.count_left != 0)
|| (for_operation == operation_intersection