From 503dbd37c270d5dd03647fb7a36058bf830315bc Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 4 May 2019 22:47:33 +0000 Subject: Only annotations with auto-caluculated rect regions are affected by g option. (S. Hirata) git-svn-id: svn://tug.org/texlive/trunk@50990 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipdfm-x/ChangeLog | 7 +++++++ Build/source/texk/dvipdfm-x/pdfdoc.c | 22 +++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 9718c155c90..2ddcc83c16e 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,10 @@ +2019-05-05 Shunsaku Hirata + + * pdfdoc.c: g option affects only annotations created by + "pdf:bann/eann" and html "a link" specials. + Report from Joseph Wright: + https://tug.org/pipermail/tex-live/2019-May/043612.html + 2019-05-03 Shunsaku Hirata * specials.c: transformation applied to current point was not diff --git a/Build/source/texk/dvipdfm-x/pdfdoc.c b/Build/source/texk/dvipdfm-x/pdfdoc.c index b03a62711b7..cecc318b7ea 100644 --- a/Build/source/texk/dvipdfm-x/pdfdoc.c +++ b/Build/source/texk/dvipdfm-x/pdfdoc.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2008-2018 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, + Copyright (C) 2008-2019 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks @@ -1780,7 +1780,6 @@ pdf_doc_add_annot (unsigned page_no, const pdf_rect *rect, pdf_doc *p = &pdoc; pdf_page *page; pdf_obj *rect_array; - double annot_grow = p->opt.annot_grow; double xpos, ypos; pdf_rect annbox; @@ -1812,10 +1811,10 @@ pdf_doc_add_annot (unsigned page_no, const pdf_rect *rect, } rect_array = pdf_new_array(); - pdf_add_array(rect_array, pdf_new_number(ROUND(annbox.llx - annot_grow, 0.001))); - pdf_add_array(rect_array, pdf_new_number(ROUND(annbox.lly - annot_grow, 0.001))); - pdf_add_array(rect_array, pdf_new_number(ROUND(annbox.urx + annot_grow, 0.001))); - pdf_add_array(rect_array, pdf_new_number(ROUND(annbox.ury + annot_grow, 0.001))); + pdf_add_array(rect_array, pdf_new_number(ROUND(annbox.llx, 0.001))); + pdf_add_array(rect_array, pdf_new_number(ROUND(annbox.lly, 0.001))); + pdf_add_array(rect_array, pdf_new_number(ROUND(annbox.urx, 0.001))); + pdf_add_array(rect_array, pdf_new_number(ROUND(annbox.ury, 0.001))); pdf_add_dict (annot_dict, pdf_new_name("Rect"), rect_array); pdf_add_array(page->annots, pdf_ref_obj(annot_dict)); @@ -2802,13 +2801,22 @@ pdf_doc_end_annot (void) void pdf_doc_break_annot (void) { + pdf_doc *p = &pdoc; + double g = p->opt.annot_grow; + if (breaking_state.dirty) { pdf_obj *annot_dict; + pdf_rect rect; /* Copy dict */ annot_dict = pdf_new_dict(); pdf_merge_dict(annot_dict, breaking_state.annot_dict); - pdf_doc_add_annot(pdf_doc_current_page_number(), &(breaking_state.rect), + rect = breaking_state.rect; + rect.llx -= g; + rect.lly -= g; + rect.urx += g; + rect.ury += g; + pdf_doc_add_annot(pdf_doc_current_page_number(), &rect, annot_dict, !breaking_state.broken); pdf_release_obj(annot_dict); -- cgit v1.2.3