Make 'set scroll_wrap' work as expected.

Thank's to wart_.
This commit is contained in:
Sebastian Ramacher 2010-11-09 16:03:53 +01:00
parent 48a2991333
commit 815f2b5243
2 changed files with 4 additions and 4 deletions

View file

@ -66,7 +66,7 @@ char* uri_command = "firefox %s"; /* uri */
/* additional settings */
gboolean show_scrollbars = FALSE;
gboolean scroll_wrap = FALSE;
gboolean scroll_wrap = TRUE;
int adjust_open = ADJUST_BESTFIT;
#define SELECTION_STYLE POPPLER_SELECTION_GLYPH
#define GOTO_MODE GOTO_LABELS /* GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET */

View file

@ -2092,11 +2092,11 @@ sc_navigate(Argument* argument)
int new_page = Zathura.PDF.page_number;
if(argument->n == NEXT)
new_page = scroll_wrap ? (new_page + 1) : ((new_page + 1) % number_of_pages);
new_page = scroll_wrap ? ((new_page + 1) % number_of_pages) : (new_page + 1);
else if(argument->n == PREVIOUS)
new_page = scroll_wrap ? (new_page - 1) : ((new_page + number_of_pages - 1) % number_of_pages);
new_page = scroll_wrap ? ((new_page + number_of_pages - 1) % number_of_pages) : (new_page - 1);
if (scroll_wrap && (new_page < 0 || new_page >= number_of_pages))
if (!scroll_wrap && (new_page < 0 || new_page >= number_of_pages))
return;
set_page(new_page);