summaryrefslogtreecommitdiff
path: root/src/cairo-bentley-ottmann-rectangular.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-08-30 10:09:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-08-30 10:09:51 +0100
commita6bcb6260ec8982493ac3411436ec007b40e4501 (patch)
treeb6656e502754f673739afbd1f5d4eecf94d0d63b /src/cairo-bentley-ottmann-rectangular.c
parent19ebf83b6717e1f02e7be14218007858edf14ef0 (diff)
downloadcairo-a6bcb6260ec8982493ac3411436ec007b40e4501.tar.gz
[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.
Diffstat (limited to 'src/cairo-bentley-ottmann-rectangular.c')
-rw-r--r--src/cairo-bentley-ottmann-rectangular.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cairo-bentley-ottmann-rectangular.c b/src/cairo-bentley-ottmann-rectangular.c
index a805f578d..53faba6b4 100644
--- a/src/cairo-bentley-ottmann-rectangular.c
+++ b/src/cairo-bentley-ottmann-rectangular.c
@@ -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;