mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 07:18:04 +02:00
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:
parent
1897156d96
commit
6ab5f89571
1 changed files with 14 additions and 17 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue