From d71f49db443ba1d5b9cd19073bba2f4ae8ef1935 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 14 Jul 2018 19:00:50 +0000 Subject: Fix a bug that Magnification is not recorded correctly. Reort by Karel Horak. git-svn-id: svn://tug.org/texlive/trunk@48195 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/synctexdir/ChangeLog | 6 ++++++ Build/source/texk/web2c/synctexdir/synctex.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Build/source/texk/web2c/synctexdir/ChangeLog b/Build/source/texk/web2c/synctexdir/ChangeLog index 223a1f9b4f9..d878f8925ed 100644 --- a/Build/source/texk/web2c/synctexdir/ChangeLog +++ b/Build/source/texk/web2c/synctexdir/ChangeLog @@ -1,3 +1,9 @@ +2018-07-15 Akira Kakuto + + * synctex.c: Fix a bug that Magnification is not correctly + recorded. Report by Karel Horak: + https://tug.org/pipermail/tex-live/2018-July/042063.html + 2018-06-13 Karl Berry * man1/synctex.1: man page list syntax. diff --git a/Build/source/texk/web2c/synctexdir/synctex.c b/Build/source/texk/web2c/synctexdir/synctex.c index 0c48281a823..52d0cad2365 100644 --- a/Build/source/texk/web2c/synctexdir/synctex.c +++ b/Build/source/texk/web2c/synctexdir/synctex.c @@ -1047,17 +1047,17 @@ void synctexsheet(integer mag) } return; } + if (SYNCTEX_GET_TOTAL_PAGES() == 0) { + /* Now it is time to properly set up the scale factor. */ + if (mag > 0) { + synctex_ctxt.magnification = mag; + } + } if (NULL != synctex_prepare_content()) { /* First possibility: the .synctex file is already open because SyncTeX was activated on the CLI * or it was activated with the \synctex macro and the first page is already shipped out. * Second possibility: tries to open the .synctex, useful if synchronization was enabled * from the source file and not from the CLI. */ - if (SYNCTEX_GET_TOTAL_PAGES() == 0) { - /* Now it is time to properly set up the scale factor. */ - if (mag > 0) { - synctex_ctxt.magnification = mag; - } - } synctex_record_sheet(SYNCTEX_GET_TOTAL_PAGES()+1); } # if SYNCTEX_DEBUG -- cgit v1.2.3