diff options
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); |