From d3d342dc27eb1497838f6079d92ee95f9875c3ed Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Wed, 25 Sep 2002 14:04:41 +0000 Subject: 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 --- apps/recorder/widgets.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'apps/recorder') 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); -- cgit v1.2.3