mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 04:28:02 +02:00
polygon-intersection: Finish any edges upon intersection
In order to keep the bookkeeping in order, and so prevent a later assert, we need to clear any edges when swapping the active edge order upon an intersection event. The active edges are then reconstructed. Fixes evince http://www.horizonhobby.com/pdf/BLH3500-Manual_EN.pdf Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
adb5eb6f69
commit
56746110fe
1 changed files with 9 additions and 4 deletions
|
|
@ -1172,6 +1172,8 @@ edges_start_or_continue (cairo_bo_edge_t *left,
|
|||
int top,
|
||||
cairo_polygon_t *polygon)
|
||||
{
|
||||
assert (right->deferred.other == NULL);
|
||||
|
||||
if (left->deferred.other == right)
|
||||
return;
|
||||
|
||||
|
|
@ -1233,13 +1235,11 @@ active_edges (cairo_bo_edge_t *left,
|
|||
}
|
||||
|
||||
right = right->next;
|
||||
} while (right);
|
||||
} while (1);
|
||||
|
||||
edges_start_or_continue (left, right, top, polygon);
|
||||
|
||||
left = right;
|
||||
if (left != NULL)
|
||||
left = left->next;
|
||||
left = right->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1324,6 +1324,11 @@ intersection_sweep (cairo_bo_event_t **start_events,
|
|||
if (e2 != e1->next)
|
||||
break;
|
||||
|
||||
if (e1->deferred.other)
|
||||
edges_end (e1, sweep_line.current_y, polygon);
|
||||
if (e2->deferred.other)
|
||||
edges_end (e2, sweep_line.current_y, polygon);
|
||||
|
||||
left = e1->prev;
|
||||
right = e2->next;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue