From 1138de4fb695a3ca5e4d06d75891fadce5cf7679 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 2 Feb 2012 21:10:20 +0000 Subject: Fix scroll bar behavior (thanks Alexandre Xavier). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2484 --- textscreen/txt_gui.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/textscreen/txt_gui.c b/textscreen/txt_gui.c index d00e3a65..af1bb0a4 100644 --- a/textscreen/txt_gui.c +++ b/textscreen/txt_gui.c @@ -269,9 +269,9 @@ void TXT_DrawHorizScrollbar(int x, int y, int w, int cursor, int range) cursor_x = x + 1; - if (range > 1) + if (range > 0) { - cursor_x += (cursor * (w - 3)) / (range - 1); + cursor_x += (cursor * (w - 3)) / range; } if (cursor_x > x + w - 2) @@ -320,9 +320,9 @@ void TXT_DrawVertScrollbar(int x, int y, int h, int cursor, int range) cursor_y = y + h - 2; } - if (range > 1) + if (range > 0) { - cursor_y += (cursor * (h - 3)) / (range - 1); + cursor_y += (cursor * (h - 3)) / range; } for (y1=y+1; y1