diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-06-16 16:34:17 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-06-17 14:53:21 +0200 |
commit | 602cc73633568beec1afe7068bb3a1040b20bba0 (patch) | |
tree | 84cb02e9c58af4e70e36b7a0878b0de1d49f6ec4 /source/fitz | |
parent | ccaf716d6c3f20731aaed277653cf3b1be4e218b (diff) | |
download | mupdf-602cc73633568beec1afe7068bb3a1040b20bba0.tar.xz |
Add mediabox argument to fz_new_display_list.
To return the proper size from fz_bound_display_list, which has been
broken since the begin_page device call was removed.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/font.c | 2 | ||||
-rw-r--r-- | source/fitz/list-device.c | 4 | ||||
-rw-r--r-- | source/fitz/util.c | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c index d534212c..792e1875 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -1131,7 +1131,7 @@ fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nested_depth) /* We've not already loaded this one! */ assert(font->t3lists[gid] == NULL); - font->t3lists[gid] = fz_new_display_list(ctx); + font->t3lists[gid] = fz_new_display_list(ctx, &font->bbox); dev = fz_new_list_device(ctx, font->t3lists[gid]); dev->flags = FZ_DEVFLAG_FILLCOLOR_UNDEFINED | diff --git a/source/fitz/list-device.c b/source/fitz/list-device.c index 5f7d69c8..18af0e20 100644 --- a/source/fitz/list-device.c +++ b/source/fitz/list-device.c @@ -1352,12 +1352,12 @@ fz_drop_display_list_imp(fz_context *ctx, fz_storable *list_) } fz_display_list * -fz_new_display_list(fz_context *ctx) +fz_new_display_list(fz_context *ctx, const fz_rect *mediabox) { fz_display_list *list = fz_malloc_struct(ctx, fz_display_list); FZ_INIT_STORABLE(list, 1, fz_drop_display_list_imp); list->list = NULL; - list->mediabox = fz_empty_rect; + list->mediabox = mediabox ? *mediabox : fz_empty_rect; list->max = 0; list->len = 0; return list; diff --git a/source/fitz/util.c b/source/fitz/util.c index 425d2181..d17cb18c 100644 --- a/source/fitz/util.c +++ b/source/fitz/util.c @@ -4,9 +4,10 @@ fz_display_list * fz_new_display_list_from_page(fz_context *ctx, fz_page *page) { fz_display_list *list; + fz_rect bounds; fz_device *dev; - list = fz_new_display_list(ctx); + list = fz_new_display_list(ctx, fz_bound_page(ctx, page, &bounds)); fz_try(ctx) { |