summaryrefslogtreecommitdiff
path: root/src/cairo-hull.c
diff options
context:
space:
mode:
authorBilly Biggs <vektor@dumbterm.net>2005-08-21 11:41:44 +0000
committerBilly Biggs <vektor@dumbterm.net>2005-08-21 11:41:44 +0000
commit17845df95b80d2a9586ba44fc5ade2c311a62c4c (patch)
tree1532789fa860717641163780455d9a46df5f5eda /src/cairo-hull.c
parentd93d56caeffb80ac92a0432ad1ebdecee5c0e2b6 (diff)
downloadcairo-17845df95b80d2a9586ba44fc5ade2c311a62c4c.tar.gz
Fix for bug #4165:
Use pointer comparison for coincident points to ensure a well-defined ordering, and avoid setting discard on both points. This fixes problems with my Mac's implementation of qsort. Final patch by Bertram Felgenhauer. Update reference images after the change.
Diffstat (limited to 'src/cairo-hull.c')
-rw-r--r--src/cairo-hull.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cairo-hull.c b/src/cairo-hull.c
index c93d70625..34e0588af 100644
--- a/src/cairo-hull.c
+++ b/src/cairo-hull.c
@@ -97,7 +97,12 @@ _cairo_hull_vertex_compare (const void *av, const void *bv)
(cairo_fixed_48_16_t) a->slope.dy * a->slope.dy);
b_dist = ((cairo_fixed_48_16_t) b->slope.dx * b->slope.dx +
(cairo_fixed_48_16_t) b->slope.dy * b->slope.dy);
- if (a_dist < b_dist) {
+ /*
+ * Use pointer comparison for coincident points to ensure
+ * a well-defined ordering, and avoid setting discard on
+ * both points.
+ */
+ if (a_dist < b_dist || (a_dist == b_dist && a < b)) {
a->discard = 1;
ret = -1;
} else {