diff options
Diffstat (limited to 'src/cairo-slope.c')
-rw-r--r-- | src/cairo-slope.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/cairo-slope.c b/src/cairo-slope.c index 35c5372..bb3b411 100644 --- a/src/cairo-slope.c +++ b/src/cairo-slope.c @@ -36,14 +36,7 @@ #include "cairoint.h" -void -_cairo_slope_init (cairo_slope_t *slope, - const cairo_point_t *a, - const cairo_point_t *b) -{ - slope->dx = b->x - a->x; - slope->dy = b->y - a->y; -} +#include "cairo-slope-private.h" /* Compare two slopes. Slope angles begin at 0 in the direction of the positive X axis and increase in the direction of the positive Y @@ -94,9 +87,7 @@ _cairo_slope_compare (const cairo_slope_t *a, const cairo_slope_t *b) * of b by an infinitesimally small amount, (that is, 'a' will * always be considered less than 'b'). */ - if (((a->dx > 0) != (b->dx > 0)) || - ((a->dy > 0) != (b->dy > 0))) - { + if ((a->dx ^ b->dx) < 0 || (a->dy ^ b->dy) < 0) { if (a->dx > 0 || (a->dx == 0 && a->dy > 0)) return +1; else |