summaryrefslogtreecommitdiff
path: root/fitz/res_path.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-07-05 17:55:18 +0100
committerRobin Watts <robin.watts@artifex.com>2012-07-05 18:02:03 +0100
commiteeaccf8444a4884801a92c0d23f66bd54c986a67 (patch)
treefc9e254dfeef4d61a80aace2f5dbbcd985580a9a /fitz/res_path.c
parentb81be8d34b179d48e677463bd7b66ffdea129517 (diff)
parent15fc25b0055dbdbfaf4257ac908d43fd5a2da19d (diff)
downloadmupdf-eeaccf8444a4884801a92c0d23f66bd54c986a67.tar.xz
Merge branch 'master' into forms
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;