From 9805dec32d8b7cb2fcc3251fdb670f5065e5f57e Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 30 Sep 2013 15:53:54 +0100 Subject: Bug 694526: Fix hang in stroking path. The first file of this bug (hang-66.pdf) hangs while stroking a VERY long line segment; so long that 'used' is sufficinetly large that: used += dash_segment_len doesn't result in a change in the value of used. The fix is to clip strokes to the edge of the gel's clip area, meaning that this should never occur. --- source/fitz/draw-edge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/fitz/draw-edge.c') diff --git a/source/fitz/draw-edge.c b/source/fitz/draw-edge.c index 59d92967..1b41414d 100644 --- a/source/fitz/draw-edge.c +++ b/source/fitz/draw-edge.c @@ -254,6 +254,19 @@ fz_bound_gel(const fz_gel *gel, fz_irect *bbox) return bbox; } +fz_rect * +fz_gel_scissor(const fz_gel *gel, fz_rect *r) +{ + fz_aa_context *ctxaa = gel->ctx->aa; + + r->x0 = gel->clip.x0 / fz_aa_hscale; + r->x1 = gel->clip.x1 / fz_aa_vscale; + r->y0 = gel->clip.y0 / fz_aa_hscale; + r->y1 = gel->clip.y1 / fz_aa_vscale; + + return r; +} + enum { INSIDE, OUTSIDE, LEAVE, ENTER }; #define clip_lerp_y(v,m,x0,y0,x1,y1,t) clip_lerp_x(v,m,y0,x0,y1,x1,t) -- cgit v1.2.3