mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 22:18:29 +02:00
[bo-rectangular] Fix assertion failure with insertion sort
We remember the location of the last insert as the next edge is likely to be nearby. However, we need to be careful when the pointer rests upon the HEAD and ensure that we begin the search from the appropriate end.
This commit is contained in:
parent
19ebf83b67
commit
a6bcb6260e
1 changed files with 4 additions and 0 deletions
|
|
@ -570,6 +570,8 @@ _cairo_bo_sweep_line_insert (cairo_bo_sweep_line_t *sweep_line,
|
|||
|
||||
/* right edge */
|
||||
pos = sweep_line->current_right;
|
||||
if (pos == &sweep_line->sweep)
|
||||
pos = sweep_line->sweep.prev;
|
||||
if (pos != &sweep_line->sweep) {
|
||||
int cmp;
|
||||
|
||||
|
|
@ -596,6 +598,8 @@ _cairo_bo_sweep_line_insert (cairo_bo_sweep_line_t *sweep_line,
|
|||
|
||||
/* left edge */
|
||||
pos = sweep_line->current_left;
|
||||
if (pos == &sweep_line->sweep)
|
||||
pos = sweep_line->sweep.next;
|
||||
if (pos != &sweep_line->sweep) {
|
||||
int cmp;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue