summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2012-02-02 21:10:20 +0000
committerSimon Howard2012-02-02 21:10:20 +0000
commit1138de4fb695a3ca5e4d06d75891fadce5cf7679 (patch)
treec6d9409852460bfd5a5d7b9e46e95d0c659c07a9
parent41c2cd24e6079e0883c1fde4230864343c7a05e8 (diff)
downloadchocolate-doom-1138de4fb695a3ca5e4d06d75891fadce5cf7679.tar.gz
chocolate-doom-1138de4fb695a3ca5e4d06d75891fadce5cf7679.tar.bz2
chocolate-doom-1138de4fb695a3ca5e4d06d75891fadce5cf7679.zip
Fix scroll bar behavior (thanks Alexandre Xavier).
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2484
-rw-r--r--textscreen/txt_gui.c8
1 files 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<y+h-1; ++y1)