1
0
Fork 0
forked from len0rd/rockbox

metronome: increase rectangle sizes to use a greater portion of the screen

Change-Id: I6c0b3faa173f5b68282c8e75b039e61d2362f749
This commit is contained in:
Paul Sauro 2025-04-07 22:53:10 +02:00 • committed by Solomon Peachy
parent 4ebf2edf32
commit e3fb41919d

View file

@ -847,6 +847,9 @@ static void metronome_draw(struct screen* display, int state)
ps = part; ps = part;
display->clear_display(); display->clear_display();
display->setfont(FONT_SYSFIXED); display->setfont(FONT_SYSFIXED);
int rectangle_height = display->lcdheight - ((SYSFONT_HEIGHT + 1) * 7);
if (rectangle_height < 12)
rectangle_height = 12;
switch(state) switch(state)
{ {
case 0: case 0:
@ -863,18 +866,18 @@ static void metronome_draw(struct screen* display, int state)
case 1: case 1:
if((beat+1) % 2 == 0) if((beat+1) % 2 == 0)
display->fillrect( display->lcdwidth/2, 0 display->fillrect( display->lcdwidth/2, 0
, display->lcdwidth, 12 ); , display->lcdwidth, rectangle_height );
else else
display->fillrect( 0, 0 display->fillrect( 0, 0
, display->lcdwidth/2-1, 12 ); , display->lcdwidth/2-1, rectangle_height );
break; break;
case 2: case 2:
if((beat+1) % 2 == 0) if((beat+1) % 2 == 0)
display->fillrect( display->lcdwidth/2, display->lcdheight-13 display->fillrect( display->lcdwidth/2, display->lcdheight - rectangle_height - 1
, display->lcdwidth, 12 ); , display->lcdwidth, rectangle_height );
else else
display->fillrect( 0, display->lcdheight-13 display->fillrect( 0, display->lcdheight - rectangle_height - 1
, display->lcdwidth/2-1, 12 ); , display->lcdwidth/2-1, rectangle_height );
break; break;
case 3: case 3:
display->puts((textlen-3)/2,0, "o.O"); display->puts((textlen-3)/2,0, "o.O");