Bug 1179859 - Fix _cairo_box_intersects_line_segment early rejection tests. r=jrmuizel

This commit is contained in:
Lee Salzman 2015-07-21 23:38:44 -04:00
parent e004f2a723
commit b50c5b4695

View File

@ -213,8 +213,7 @@ _cairo_box_intersects_line_segment (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 (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 */