summaryrefslogtreecommitdiff
path: root/apps/gui/scrollbar.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-10-08 14:26:36 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-10-08 14:26:36 +0000
commitcc8918e909acf3eee6011b78ed9b6e200cfc1d0b (patch)
tree68094aa44573038f3ce66fba33cc00429719f50b /apps/gui/scrollbar.c
parent09d897508454adb6471c5dbc74057c282bfe8446 (diff)
fix displaying of the slider when default is used for pb->y and pb->height.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28220 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/scrollbar.c')
-rw-r--r--apps/gui/scrollbar.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c
index 17d280b1ca..83e86c1527 100644
--- a/apps/gui/scrollbar.c
+++ b/apps/gui/scrollbar.c
@@ -224,6 +224,15 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
starty = start;
}
+ if (bm->width < startx)
+ width = 0;
+ else if (bm->width < startx + width)
+ width = bm->width - startx;
+ if (bm->height < starty)
+ height = 0;
+ else if (bm->height < starty + height)
+ height = bm->height - starty;
+
#if LCD_DEPTH > 1
if (bm->format == FORMAT_MONO)
#endif