From a5b1fdbcf9e56e134f0f14d40a9710d73f131e2d Mon Sep 17 00:00:00 2001 From: malc Date: Fri, 15 Feb 2019 21:45:08 +0300 Subject: [PATCH] Sync with upstream --- link.c | 11 +++++++---- misc/getmupdf.sh | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/link.c b/link.c index c35a5d6..976ee90 100644 --- a/link.c +++ b/link.c @@ -3704,7 +3704,7 @@ void ml_addannot (value ptr_v, value x_v, value y_v, value contents_v) if (pdf) { pdf_annot *annot; struct page *page; - fz_point p; + fz_rect r; char *s = String_val (ptr_v); page = parse_pointer (__func__, s); @@ -3712,10 +3712,13 @@ void ml_addannot (value ptr_v, value x_v, value y_v, value contents_v) pdf_page_from_fz_page (state.ctx, page->fzpage), PDF_ANNOT_TEXT); - p.x = Int_val (x_v); - p.y = Int_val (y_v); + r.x0 = Int_val (x_v) - 10; + r.y0 = Int_val (y_v) - 10; + r.x1 = r.x0 + 20; + r.y1 = r.y0 + 20; pdf_set_annot_contents (state.ctx, annot, String_val (contents_v)); - pdf_set_text_annot_position (state.ctx, annot, p); + pdf_set_annot_rect (state.ctx, annot, r); + state.dirty = 1; } CAMLreturn0; diff --git a/misc/getmupdf.sh b/misc/getmupdf.sh index 7a6e37f..42be6fc 100644 --- a/misc/getmupdf.sh +++ b/misc/getmupdf.sh @@ -3,7 +3,7 @@ set -eu MUPDF_OUTPUT_DIR="$1" MUPDF_URL="https://github.com/ArtifexSoftware/mupdf" -MUPDF_DESIRED_VERSION="cb530cdc26f5e04601f00140da02299b4b59a55b" +MUPDF_DESIRED_VERSION="a17da4ced3a9c97bcdfda10cfeac24bc9f559a71" if [ ! -d ${MUPDF_OUTPUT_DIR} ]; then echo "mupdf does not exist, fetching it from ${MUPDF_URL}" -- 2.11.4.GIT