forked from len0rd/rockbox
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
This commit is contained in:
parent
e4d1bda5e4
commit
d3d342dc27
1 changed files with 39 additions and 0 deletions
|
@ -28,6 +28,19 @@ void progressbar(int x, int y, int width, int height, int percent, int direction
|
||||||
{
|
{
|
||||||
int pos;
|
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 */
|
/* draw box */
|
||||||
lcd_drawrect(x, y, width, height);
|
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;
|
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 */
|
/* draw box */
|
||||||
lcd_drawrect(x, y, width, height);
|
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 start;
|
||||||
int size;
|
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 */
|
/* draw box */
|
||||||
lcd_drawrect(x, y, width, height);
|
lcd_drawrect(x, y, width, height);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue