diff options
Diffstat (limited to 'apps/gui/scrollbar.c')
-rw-r--r-- | apps/gui/scrollbar.c | 9 |
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 |