stroke: Use the tessellator to resolve overlapping strokes

If the stroke is too large, the strokes around the box overlap and we
fail to generate the canonical form of the boxes. So if we detect that
the boxes overlap, feed them through the tessellator to reduce them to
canonical form.

Fixes line-width-overlap.

Based on a patch by  Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-09-28 23:54:00 +01:00
parent 30eac7b2c5
commit 2994b0c634

View file

@ -619,7 +619,10 @@ _cairo_path_fixed_stroke_rectilinear_to_boxes (const cairo_path_fixed_t *path,
}
if (! rectilinear_stroker.dash.dashed &&
_cairo_path_fixed_is_stroke_box (path, &box))
_cairo_path_fixed_is_stroke_box (path, &box) &&
/* if the segments overlap we need to feed them into the tessellator */
box.p2.x - box.p1.x > 2* rectilinear_stroker.half_line_width &&
box.p2.y - box.p1.y > 2* rectilinear_stroker.half_line_width)
{
cairo_box_t b;