From 81626cb122701420a15dae49ed0e7ec3c442e9d3 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 9 May 2013 20:01:37 +0100 Subject: Update fz_bound_{text,path} functions. Pass stroke state into fz_bound_text to allow for stroked text. Simplifies some calling code. Add consts to clarify the meanings of the calls. --- fitz/res_text.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fitz/res_text.c') diff --git a/fitz/res_text.c b/fitz/res_text.c index 09a658b1..57e02cf9 100644 --- a/fitz/res_text.c +++ b/fitz/res_text.c @@ -53,7 +53,7 @@ fz_clone_text(fz_context *ctx, fz_text *old) } fz_rect * -fz_bound_text(fz_context *ctx, fz_text *text, const fz_matrix *ctm, fz_rect *bbox) +fz_bound_text(fz_context *ctx, fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_rect *bbox) { fz_matrix tm, trm; fz_rect gbox; @@ -90,12 +90,16 @@ fz_bound_text(fz_context *ctx, fz_text *text, const fz_matrix *ctm, fz_rect *bbo } } + if (stroke) + fz_adjust_rect_for_stroke(bbox, stroke, ctm); + /* Compensate for the glyph cache limited positioning precision */ bbox->x0 -= 1; bbox->y0 -= 1; bbox->x1 += 1; bbox->y1 += 1; + return bbox; } -- cgit v1.2.3