Fix comparison so that it results in a stable sort. This should fix some rendering bugs due to broken pens.

This commit is contained in:
Carl Worth 2004-10-21 18:26:25 +00:00
parent de115d07c3
commit 215d5c5a46
3 changed files with 14 additions and 4 deletions

View file

@ -1,5 +1,9 @@
2004-10-21 Carl Worth <cworth@cworth.org>
* src/cairo_hull.c (_cairo_hull_vertex_compare): Fix comparison so
that it results in a stable sort. This should fix some rendering
bugs due to broken pens.
* TODO: Add items on custom caps and getting access to hidden
image data

View file

@ -97,10 +97,13 @@ _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)
if (a_dist < b_dist) {
a->discard = 1;
else
ret = -1;
} else {
b->discard = 1;
ret = 1;
}
}
return ret;

View file

@ -97,10 +97,13 @@ _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)
if (a_dist < b_dist) {
a->discard = 1;
else
ret = -1;
} else {
b->discard = 1;
ret = 1;
}
}
return ret;