diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-04-16 17:45:37 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-04-19 11:25:42 +0100 |
commit | b054f9d0764f38f576fff63bf61488d1de37a447 (patch) | |
tree | fef181bbf3b37ee380cb6ac0ae8102b9e9d2d6ec /draw | |
parent | 20e279acb98294b3587088c7d42268433481c6c3 (diff) | |
download | mupdf-b054f9d0764f38f576fff63bf61488d1de37a447.tar.xz |
Add new function to return the accurate bbox of a path.
As requested by customer 530.
Diffstat (limited to 'draw')
-rw-r--r-- | draw/draw_device.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/draw/draw_device.c b/draw/draw_device.c index 6eca2315..1a807a4c 100644 --- a/draw/draw_device.c +++ b/draw/draw_device.c @@ -2099,3 +2099,24 @@ fz_new_draw_device_type3(fz_context *ctx, fz_pixmap *dest) ddev->flags |= FZ_DRAWDEV_FLAGS_TYPE3; return dev; } + +fz_irect * +fz_bound_path_accurate(fz_context *ctx, fz_irect *bbox, const fz_irect *scissor, fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth) +{ + fz_gel *gel = fz_new_gel(ctx); + + fz_reset_gel(gel, scissor); + if (stroke) + { + if (stroke->dash_len > 0) + fz_flatten_dash_path(gel, path, stroke, ctm, flatness, linewidth); + else + fz_flatten_stroke_path(gel, path, stroke, ctm, flatness, linewidth); + } + else + fz_flatten_fill_path(gel, path, ctm, flatness); + fz_bound_gel(gel, bbox); + fz_free_gel(gel); + + return bbox; +} |