summaryrefslogtreecommitdiff
path: root/src/cairo-path-stroke-boxes.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-09-28 23:54:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-29 00:26:06 +0100
commit2994b0c634158f681d3ac2894270d609ed5af424 (patch)
tree1b3162b687e39c08573c30c195d2b8d546f5e299 /src/cairo-path-stroke-boxes.c
parent30eac7b2c5a3a2a9c5de4886cdd38666ef19cddb (diff)
downloadcairo-2994b0c634158f681d3ac2894270d609ed5af424.tar.gz
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>
Diffstat (limited to 'src/cairo-path-stroke-boxes.c')
-rw-r--r--src/cairo-path-stroke-boxes.c5
1 files changed, 4 insertions, 1 deletions
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;