diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-07-07 13:54:08 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-07-08 17:21:23 +0200 |
commit | adc4932af62fde5e9eb1106f751659962cb89dc3 (patch) | |
tree | caa6b5bbd4920cfff7174cb81f25dc12e19b58e7 /source/pdf/pdf-annot.c | |
parent | 048948c9705c47b0ccd4ebf835d4612496ce6eb0 (diff) | |
download | mupdf-adc4932af62fde5e9eb1106f751659962cb89dc3.tar.xz |
Slim pdf_annot struct: remove cached matrix field.
Diffstat (limited to 'source/pdf/pdf-annot.c')
-rw-r--r-- | source/pdf/pdf-annot.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c index c5354c71..00e5b983 100644 --- a/source/pdf/pdf-annot.c +++ b/source/pdf/pdf-annot.c @@ -402,8 +402,9 @@ pdf_drop_annots(fz_context *ctx, pdf_annot *annot) } } +/* Create transform to fit appearance stream to annotation Rect */ void -pdf_transform_annot(fz_context *ctx, pdf_annot *annot) +pdf_annot_transform(fz_context *ctx, pdf_annot *annot, fz_matrix *annot_ctm) { fz_rect bbox = annot->ap->bbox; fz_rect rect; @@ -423,7 +424,7 @@ pdf_transform_annot(fz_context *ctx, pdf_annot *annot) x = rect.x0 - bbox.x0; y = rect.y0 - bbox.y0; - fz_pre_scale(fz_translate(&annot->matrix, x, y), w, h); + fz_pre_scale(fz_translate(annot_ctm, x, y), w, h); } fz_annot_type pdf_annot_obj_type(fz_context *ctx, pdf_obj *obj) @@ -589,9 +590,10 @@ pdf_load_annots(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_obj *ann if (pdf_is_stream(ctx, n)) { annot->ap = pdf_load_xobject(ctx, doc, n); - pdf_transform_annot(ctx, annot); annot->ap_iteration = annot->ap->iteration; } + else + fz_warn(ctx, "no appearance stream for annotation %d 0 R", pdf_to_num(ctx, annot->obj)); if (obj == doc->focus_obj) doc->focus = annot; |