diff --git a/src/cairo-rectangle.c b/src/cairo-rectangle.c index 2d51d7b..f846343 100644 --- a/src/cairo-rectangle.c +++ b/src/cairo-rectangle.c @@ -213,8 +213,7 @@ _cairo_box_intersects_line_segment (const cairo_box_t *box, cairo_line_t *line) xlen = - xlen; } - if ((t1 < 0 || t1 > xlen) && - (t2 < 0 || t2 > xlen)) + if (t1 > xlen || t2 < 0) return FALSE; } else { /* Fully vertical line -- check that X is in bounds */ @@ -232,8 +231,7 @@ _cairo_box_intersects_line_segment (const cairo_box_t *box, cairo_line_t *line) ylen = - ylen; } - if ((t3 < 0 || t3 > ylen) && - (t4 < 0 || t4 > ylen)) + if (t3 > ylen || t4 < 0) return FALSE; } else { /* Fully horizontal line -- check Y */