From aeaa900a9439976477486c2a0c94e5554d9a3cae Mon Sep 17 00:00:00 2001 From: Sebastian Neuser Date: Wed, 1 Jan 2014 19:19:28 +0100 Subject: [PATCH] Preserve horizontal position when scrolling to PAGE_TOP/BOTTOM --- shortcuts.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index e0a141f..23ea84e 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -507,12 +507,14 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, /* If PAGE_TOP or PAGE_BOTTOM, go there and we are done */ if (argument->n == PAGE_TOP) { - page_number_to_position(zathura->document, page_id, 0.5, 0.0, &pos_x, &pos_y); - position_set(zathura, -1, pos_y); + double dontcare = 0.5; + page_number_to_position(zathura->document, page_id, dontcare, 0.0, &dontcare, &pos_y); + position_set(zathura, pos_x, pos_y); return false; } else if (argument->n == PAGE_BOTTOM) { - page_number_to_position(zathura->document, page_id, 0.5, 1.0, &pos_x, &pos_y); - position_set(zathura, -1, pos_y); + double dontcare = 0.5; + page_number_to_position(zathura->document, page_id, dontcare, 1.0, &dontcare, &pos_y); + position_set(zathura, pos_x, pos_y); return false; }