summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-surface-private.h
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2017-08-26 09:58:48 +0930
committerAdrian Johnson <ajohnson@redneon.com>2017-08-26 16:26:12 +0930
commitdf37baf7895ef9acc71f3627b22e7368c8af3ea1 (patch)
tree31a859c66d5b9ab393599d261900012c470cbf9d /src/cairo-pdf-surface-private.h
parent74c6e3ae1d356e8bb4c7043cb9d3897c45cc0f79 (diff)
downloadcairo-df37baf7895ef9acc71f3627b22e7368c8af3ea1.tar.gz
pdf: fix link positions
Converting the link position from cairo to pdf coordinates requires the page height. Since the link may point to a different page, build an array of the height of each page and use the target page height for the conversion. Don't default to a [0,0] position if "pos" is not specified. PDF allows a null destination position to be specified which means don't change the position if the page is already displayed or show top left if switching to a different page. This is more useful default particularly for external files where the coordinates (which must be in PDF coordinates as we don't know the page height) of the top left corner may not be known.
Diffstat (limited to 'src/cairo-pdf-surface-private.h')
-rw-r--r--src/cairo-pdf-surface-private.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h
index a5c7d0ed3..be721af24 100644
--- a/src/cairo-pdf-surface-private.h
+++ b/src/cairo-pdf-surface-private.h
@@ -179,7 +179,7 @@ typedef struct _cairo_pdf_struct_tree_node {
struct tag_extents extents;
cairo_pdf_resource_t res;
cairo_link_attrs_t link_attrs;
- double page_height;
+ int src_page; /* page number containing the link */
} annot;
cairo_list_t link;
} cairo_pdf_struct_tree_node_t;
@@ -189,7 +189,6 @@ typedef struct _cairo_pdf_named_dest {
struct tag_extents extents;
cairo_dest_attrs_t attrs;
int page;
- double page_height;
cairo_bool_t referenced;
} cairo_pdf_named_dest_t;
@@ -267,6 +266,7 @@ struct _cairo_pdf_surface {
cairo_array_t smask_groups;
cairo_array_t knockout_group;
cairo_array_t jbig2_global;
+ cairo_array_t page_heights;
cairo_scaled_font_subsets_t *font_subsets;
cairo_array_t fonts;