summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-09 00:14:48 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-10 10:46:50 +0000
commit07b540fd35d7312bbfb362f22dac20f57f6900e6 (patch)
tree686539395f62116c9624a4ea70b386a1fa81fa97 /src
parent247c42357c2aaccfbcccd0656b22fc73c0303194 (diff)
bentley-ottmann: Sort by edge bounding boxes before computing x
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/cairo-bentley-ottmann.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cairo-bentley-ottmann.c b/src/cairo-bentley-ottmann.c
index 866358fca..a075b404f 100644
--- a/src/cairo-bentley-ottmann.c
+++ b/src/cairo-bentley-ottmann.c
@@ -570,6 +570,13 @@ _cairo_bo_sweep_line_compare_edges (cairo_bo_sweep_line_t *sweep_line,
/* compare the edges if not identical */
if (! _line_equal (&a->edge.line, &b->edge.line)) {
+ if (MAX (a->edge.line.p1.x, a->edge.line.p2.x) <
+ MIN (b->edge.line.p1.x, b->edge.line.p2.x))
+ return -1;
+ else if (MIN (a->edge.line.p1.x, a->edge.line.p2.x) >
+ MAX (b->edge.line.p1.x, b->edge.line.p2.x))
+ return 1;
+
cmp = edges_compare_x_for_y (a, b, sweep_line->current_y);
if (cmp)
return cmp;