bo-rectangular: Fix incorrect skipping of colinear eo edges

Fixes test/bug-bo-rectangular

After skipping edges, we need to bd careful to only terminate the box on
a closing edge.
This commit is contained in:
Chris Wilson 2010-02-23 08:54:58 +00:00
parent 1897156d96
commit 6ab5f89571

View file

@ -422,9 +422,6 @@ active_edges_to_traps (sweep_line_t *sweep,
winding += right->dir;
if (winding == 0) {
if (right->next == &sweep->tail)
break;
/* skip co-linear edges */
if (likely (right->x != right->next->x))
break;
@ -440,30 +437,31 @@ active_edges_to_traps (sweep_line_t *sweep,
pos = right->next;
} while (pos != &sweep->tail);
} else {
edge_t *left, *right;
do {
left = pos;
pos = left->next;
do {
right = pos;
pos = pos->next;
edge_t *right = pos->next;
int count = 0;
if (right->right != NULL) {
do {
/* End all subsumed traps */
if (unlikely (right->right != NULL)) {
edge_end_box (sweep,
right, top, do_traps, container);
}
if (pos == &sweep->tail)
break;
if (++count & 1) {
/* skip co-linear edges */
if (likely (right->x != right->next->x))
break;
}
/* skip co-linear edges */
if (right->x != pos->x)
break;
right = right->next;
} while (TRUE);
edge_start_or_continue_box (sweep,
left, right, top,
pos, right, top,
do_traps, container);
pos = right->next;
} while (pos != &sweep->tail);
}
@ -717,7 +715,6 @@ _cairo_bentley_ottmann_tessellate_rectangular_traps (cairo_traps_t *traps,
dump_traps (traps, "bo-rects-traps-out.txt");
return status;
}