summaryrefslogtreecommitdiffstats
path: root/source/scrollbar.c
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-09-03 22:16:19 +0200
committerQC <qball@gmpclient.org>2015-09-03 22:16:19 +0200
commitd3481de3d674de0cb5bdd479f5edfce212ef5eb6 (patch)
tree973fd8035620e621bde2c67033ed3b0898211224 /source/scrollbar.c
parent4bbbecd17d2b890b686e07c0ba0048ee4eb520dc (diff)
Fix small 1 px. offset
Diffstat (limited to 'source/scrollbar.c')
-rw-r--r--source/scrollbar.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/scrollbar.c b/source/scrollbar.c
index 5b41de8b..977aa1a0 100644
--- a/source/scrollbar.c
+++ b/source/scrollbar.c
@@ -37,7 +37,7 @@
extern Display *display;
-#define SCROLLBAR_WIDTH 10
+#define SCROLLBAR_WIDTH 10
scrollbar *scrollbar_create ( Window parent, XVisualInfo *vinfo, Colormap map,
short x, short y, short w, short h )
@@ -108,13 +108,13 @@ void scrollbar_draw ( scrollbar *sb )
short height = sb->pos_length * sec;
short y = sb->pos * sec + 1;
// Set max pos.
- y = MIN ( y, bh - 2 );
+ y = MIN ( y, bh - 2 );
// Never go out of bar.
height = MAX ( 2, height );
// Cap length;
- height = MIN ( bh - y, ( height ) );
+ height = MIN ( bh - y + 1, ( height ) );
// Redraw base window
XClearWindow ( display, sb->window );
- // Paint the handle.
+ // Paint the handle.
XFillRectangle ( display, sb->window, sb->gc, 1, y, SCROLLBAR_WIDTH - 2, height );
}