summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2010-04-12 19:25:28 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2010-04-12 19:25:28 +0000
commit305dd65650c4a922a8164d7e051700ab6ce2cdac (patch)
treea9317e7605b9677f3e5352a581c6d64224562242 /apps/plugins
parent199f3bd7c205769256037f021162801c93faee9f (diff)
Text viewer: Make calculation clearer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25611 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/viewer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index 618da50807..ebda4bd7b3 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -1560,8 +1560,9 @@ static void viewer_draw(int col)
/* display on screen the displayed part of the line */
if (col != -1)
{
- int dpage = (cline+i <= display_lines)?cpage:cpage+1;
- int dline = cline+i - ((cline+i <= display_lines)?0:display_lines);
+ bool in_page = (cline+i > display_lines);
+ int dpage = cpage + (in_page ? 0 : 1);
+ int dline = cline + i - (in_page ? 0 : display_lines);
bool bflag = (viewer_find_bookmark(dpage, dline) >= 0);
#ifdef HAVE_LCD_BITMAP
int dy = i * pf->height + header_height;