diff options
author | Markus Braun <markus.braun@krawel.de> | 2002-09-25 14:04:41 +0000 |
---|---|---|
committer | Markus Braun <markus.braun@krawel.de> | 2002-09-25 14:04:41 +0000 |
commit | d3d342dc27eb1497838f6079d92ee95f9875c3ed (patch) | |
tree | 8fa72fa6ece274d5aac31b54744c2ad6b61a505f /apps/recorder | |
parent | e4d1bda5e40a219a088fd391e195106fab516af9 (diff) |
progressbar, slidebar and scrollbar are not drawn, if they don't fit on
screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2414 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r-- | apps/recorder/widgets.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/apps/recorder/widgets.c b/apps/recorder/widgets.c index dae9e58b32..9ee7dbc66a 100644 --- a/apps/recorder/widgets.c +++ b/apps/recorder/widgets.c @@ -28,6 +28,19 @@ void progressbar(int x, int y, int width, int height, int percent, int direction { int pos; + /* check position and dimensions */ + if(x < 0) + return; + + if(y < 0) + return; + + if(x + width > LCD_WIDTH) + return; + + if(y + height > LCD_HEIGHT) + return; + /* draw box */ lcd_drawrect(x, y, width, height); @@ -76,6 +89,19 @@ void slidebar(int x, int y, int width, int height, int percent, int direction) { int pos; + /* check position and dimensions */ + if(x < 0) + return; + + if(y < 0) + return; + + if(x + width > LCD_WIDTH) + return; + + if(y + height > LCD_HEIGHT) + return; + /* draw box */ lcd_drawrect(x, y, width, height); @@ -128,6 +154,19 @@ void scrollbar(int x, int y, int width, int height, int items, int min_shown, in int start; int size; + /* check position and dimensions */ + if(x < 0) + return; + + if(y < 0) + return; + + if(x + width > LCD_WIDTH) + return; + + if(y + height > LCD_HEIGHT) + return; + /* draw box */ lcd_drawrect(x, y, width, height); |