mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-27 16:18:13 +02:00
Followup patch to dashed stroke optimization
Make sure that we don't test lines that start or end inside the box, since our algorithm will find intersections on the wrong ends on the line, and not count them.
This commit is contained in:
parent
7b788ce7ca
commit
1d93e14876
1 changed files with 8 additions and 2 deletions
|
|
@ -111,8 +111,14 @@ _cairo_box_intersects_line (cairo_box_t *box, cairo_line_t *line)
|
|||
cairo_fixed_t t1, t2, t3, t4;
|
||||
cairo_int64_t t1y, t2y, t3x, t4x;
|
||||
|
||||
cairo_fixed_t xlen = P2x - P1x;
|
||||
cairo_fixed_t ylen = P2y - P1y;
|
||||
cairo_fixed_t xlen, ylen;
|
||||
|
||||
if (_cairo_box_contains_point(box, &line->p1) ||
|
||||
_cairo_box_contains_point(box, &line->p2))
|
||||
return TRUE;
|
||||
|
||||
xlen = P2x - P1x;
|
||||
ylen = P2y - P1y;
|
||||
|
||||
if (xlen) {
|
||||
if (xlen > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue