summaryrefslogtreecommitdiff
path: root/source/fitz/draw-edge.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-09-30 15:53:54 +0100
committerRobin Watts <robin.watts@artifex.com>2013-09-30 17:21:42 +0100
commit9805dec32d8b7cb2fcc3251fdb670f5065e5f57e (patch)
treea516ea2bf8d2fb98421cf3dcb51a80ef1e69b6fa /source/fitz/draw-edge.c
parentdc371071308690a9dc84701fdb2cce6a01ba9338 (diff)
downloadmupdf-9805dec32d8b7cb2fcc3251fdb670f5065e5f57e.tar.xz
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.
Diffstat (limited to 'source/fitz/draw-edge.c')
-rw-r--r--source/fitz/draw-edge.c13
1 files changed, 13 insertions, 0 deletions
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)