From 2994b0c634158f681d3ac2894270d609ed5af424 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 28 Sep 2011 23:54:00 +0100 Subject: [PATCH] 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 Signed-off-by: Chris Wilson --- src/cairo-path-stroke-boxes.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cairo-path-stroke-boxes.c b/src/cairo-path-stroke-boxes.c index 794250b11..12e4dd165 100644 --- a/src/cairo-path-stroke-boxes.c +++ b/src/cairo-path-stroke-boxes.c @@ -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;