From 599fa9a6279a4e7dda4b6a46bef6bf4958bb0399 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Tue, 15 Aug 2006 14:06:29 +0000 Subject: fix "off-by-one" bug in paginated scrolling with the title git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10589 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/list.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/gui/list.c b/apps/gui/list.c index f48d4d9ee1..0d8b4d1879 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -377,11 +377,11 @@ void gui_list_select_next(struct gui_list * gui_list) void gui_list_select_previous(struct gui_list * gui_list) { + int nb_lines = gui_list->display->nb_lines; + if (gui_list->title) + nb_lines--; if( gui_list->selected_item-gui_list->selected_size < 0 ) { - int nb_lines = gui_list->display->nb_lines; - if (gui_list->title) - nb_lines--; if(gui_list->limit_scroll) return; /* we have aleady reached the top of the list */ @@ -396,7 +396,6 @@ void gui_list_select_previous(struct gui_list * gui_list) else { int item_pos; - int nb_lines = gui_list->display->nb_lines; gui_list->selected_item-=gui_list->selected_size; item_pos = gui_list->selected_item - gui_list->start_item; if (global_settings.scroll_paginated) -- cgit v1.2.3