summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Braun <markus.braun@krawel.de>2002-09-25 14:04:41 +0000
committerMarkus Braun <markus.braun@krawel.de>2002-09-25 14:04:41 +0000
commitd3d342dc27eb1497838f6079d92ee95f9875c3ed (patch)
tree8fa72fa6ece274d5aac31b54744c2ad6b61a505f
parente4d1bda5e40a219a088fd391e195106fab516af9 (diff)
downloadrockbox-d3d342dc27eb1497838f6079d92ee95f9875c3ed.tar.gz
rockbox-d3d342dc27eb1497838f6079d92ee95f9875c3ed.zip
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
-rw-r--r--apps/recorder/widgets.c39
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
28{ 28{
29 int pos; 29 int pos;
30 30
31 /* check position and dimensions */
32 if(x < 0)
33 return;
34
35 if(y < 0)
36 return;
37
38 if(x + width > LCD_WIDTH)
39 return;
40
41 if(y + height > LCD_HEIGHT)
42 return;
43
31 /* draw box */ 44 /* draw box */
32 lcd_drawrect(x, y, width, height); 45 lcd_drawrect(x, y, width, height);
33 46
@@ -76,6 +89,19 @@ void slidebar(int x, int y, int width, int height, int percent, int direction)
76{ 89{
77 int pos; 90 int pos;
78 91
92 /* check position and dimensions */
93 if(x < 0)
94 return;
95
96 if(y < 0)
97 return;
98
99 if(x + width > LCD_WIDTH)
100 return;
101
102 if(y + height > LCD_HEIGHT)
103 return;
104
79 /* draw box */ 105 /* draw box */
80 lcd_drawrect(x, y, width, height); 106 lcd_drawrect(x, y, width, height);
81 107
@@ -128,6 +154,19 @@ void scrollbar(int x, int y, int width, int height, int items, int min_shown, in
128 int start; 154 int start;
129 int size; 155 int size;
130 156
157 /* check position and dimensions */
158 if(x < 0)
159 return;
160
161 if(y < 0)
162 return;
163
164 if(x + width > LCD_WIDTH)
165 return;
166
167 if(y + height > LCD_HEIGHT)
168 return;
169
131 /* draw box */ 170 /* draw box */
132 lcd_drawrect(x, y, width, height); 171 lcd_drawrect(x, y, width, height);
133 172