summaryrefslogtreecommitdiff
path: root/fitz/res_path.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-06-27 19:43:37 +0100
committerRobin Watts <robin.watts@artifex.com>2012-06-27 19:43:37 +0100
commitbf9d830adbca9978f82439af7f9b742d00d97214 (patch)
tree06c24666c836e37576b89927de8d4c4c2d4aaa6e /fitz/res_path.c
parent471b33850c85cd5e3d710f490a30f86655519084 (diff)
downloadmupdf-bf9d830adbca9978f82439af7f9b742d00d97214.tar.xz
Fix clipping of stroked text seen in displaylist cases.
When calculating the displaylist node rectangles, we were failing to adjust for linewidth/mitrewidth etc. This could result in glyphs being clipped; see normal_130.pdf for example.
Diffstat (limited to 'fitz/res_path.c')
-rw-r--r--fitz/res_path.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/fitz/res_path.c b/fitz/res_path.c
index e3f07192..b8a6a1a2 100644
--- a/fitz/res_path.c
+++ b/fitz/res_path.c
@@ -275,22 +275,32 @@ fz_bound_path(fz_context *ctx, fz_path *path, fz_stroke_state *stroke, fz_matrix
if (stroke)
{
- float expand = stroke->linewidth;
- if (expand == 0)
- expand = 1.0f;
- expand *= fz_matrix_max_expansion(ctm);
- if ((stroke->linejoin == FZ_LINEJOIN_MITER || stroke->linejoin == FZ_LINEJOIN_MITER_XPS) && stroke->miterlimit > 1)
- expand *= stroke->miterlimit;
- r.x0 -= expand;
- r.y0 -= expand;
- r.x1 += expand;
- r.y1 += expand;
+ fz_adjust_rect_for_stroke(&r, stroke, &ctm);
}
return r;
}
void
+fz_adjust_rect_for_stroke(fz_rect *r, fz_stroke_state *stroke, fz_matrix *ctm)
+{
+ float expand;
+
+ if (!stroke)
+ return;
+ expand = stroke->linewidth;
+ if (expand == 0)
+ expand = 1.0f;
+ expand *= fz_matrix_max_expansion(*ctm);
+ if ((stroke->linejoin == FZ_LINEJOIN_MITER || stroke->linejoin == FZ_LINEJOIN_MITER_XPS) && stroke->miterlimit > 1)
+ expand *= stroke->miterlimit;
+ r->x0 -= expand;
+ r->y0 -= expand;
+ r->x1 += expand;
+ r->y1 += expand;
+}
+
+void
fz_transform_path(fz_context *ctx, fz_path *path, fz_matrix ctm)
{
fz_point p;