# HG changeset patch # User Ideenmodellierer # Date 1546810235 -3600 # Node ID e6b190f5fbc72e70b12480ecedf9f76164c1c79e # Parent b848056057cea474c15b205b4afe9449bc9acc1b Submenus may have 6 items Write_content_simple is screen orientation aware => remove not needed code diff -r b848056057ce -r e6b190f5fbc7 Discovery/Src/tMenuEdit.c --- a/Discovery/Src/tMenuEdit.c Sun Jan 06 22:27:46 2019 +0100 +++ b/Discovery/Src/tMenuEdit.c Sun Jan 06 22:30:35 2019 +0100 @@ -1602,14 +1602,15 @@ if(!settingsGetPointer()->FlipDisplay) { y0 = (int16_t)ident[forThisIdentID].coord[2]; + y0 -= ME_Y_LINE1; } else { - y0 = 390 - (int16_t)ident[forThisIdentID].coord[2]; + y0 = 390 + 25 - (int16_t)ident[forThisIdentID].coord[2]; } - y0 -= ME_Y_LINE1; + y0 /= ME_Y_LINE_STEP; - if((y0 >= 0) && (y0 <=5)) + if((y0 >= 0) && (y0 <=6)) lineMinusOne = y0; else lineMinusOne = 0; @@ -1620,7 +1621,7 @@ } else { - GFX_SetFrameBottom((tMEcursorNew.FBStartAdress)+ (390 - 65 *(5-lineMinusOne-1)) *2, 0, 480-390-25, 800, 390); + GFX_SetFrameBottom((tMEcursorNew.FBStartAdress)+ (390 - 65 *(6-lineMinusOne)) *2, 0, 480-390-25, 800, 390); } } @@ -1658,7 +1659,7 @@ if(!pSettings->FlipDisplay) { - GFX_clean_area(&tMEscreen, 0, 800, 480-24,480); + GFX_clean_area(&tMEscreen, 0, 800, 479-24,480); } else { @@ -1672,14 +1673,8 @@ localtext[0] = TXT_2BYTE; localtext[1] = left2ByteCode; localtext[2] = 0; - if(!pSettings->FlipDisplay) - { - write_content_simple(&tMEscreen, 0, 800, 480-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen); - } - else - { - write_content_simple(&tMEscreen, 0, 800, 0, &FontT24,localtext,CLUT_ButtonSurfaceScreen); - } + + write_content_simple(&tMEscreen, 0, 800, 479-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen); } if(middle2ByteCode) @@ -1688,14 +1683,8 @@ localtext[1] = TXT_2BYTE; localtext[2] = middle2ByteCode; localtext[3] = 0; - if(!pSettings->FlipDisplay) - { - write_content_simple(&tMEscreen, 0, 800, 480-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen); - } - else - { - write_content_simple(&tMEscreen, 0, 800, 0, &FontT24,localtext,CLUT_ButtonSurfaceScreen); - } + + write_content_simple(&tMEscreen, 0, 800, 479-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen); } if(right2ByteCode) @@ -1704,14 +1693,8 @@ localtext[1] = TXT_2BYTE; localtext[2] = right2ByteCode; localtext[3] = 0; - if(!pSettings->FlipDisplay) - { - write_content_simple(&tMEscreen, 0, 800, 480-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen); - } - else - { - write_content_simple(&tMEscreen, 0, 800, 0, &FontT24,localtext,CLUT_ButtonSurfaceScreen); - } + + write_content_simple(&tMEscreen, 0, 800, 479-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen); } }