From e7719b15d0f72000835a38754c00598fbc841598 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 10 Oct 2018 12:32:41 +0200 Subject: gl: Fix launching mupdf-gl to the page number passed on the command line. --- platform/gl/gl-main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'platform') diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c index ec38f6f7..74e03cd3 100644 --- a/platform/gl/gl-main.c +++ b/platform/gl/gl-main.c @@ -849,22 +849,23 @@ static void load_document(void) fz_catch(ctx) outline = NULL; + load_history(); + pdf = pdf_specifics(ctx, doc); if (pdf) { if (enable_js) pdf_enable_js(ctx, pdf); if (anchor) - currentpage = pdf_lookup_anchor(ctx, pdf, anchor, NULL, NULL); + jump_to_page(pdf_lookup_anchor(ctx, pdf, anchor, NULL, NULL)); } else { if (anchor) - currentpage = fz_atoi(anchor) - 1; + jump_to_page(fz_atoi(anchor) - 1); } anchor = NULL; - load_history(); currentpage = fz_clampi(currentpage, 0, fz_count_pages(ctx, doc) - 1); } -- cgit v1.2.3