mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 13:56:24 +00:00
Apply some cleanup for recent merge
Combine 1/(rows+1) with u8g.getHeight() to get rowHeight and just use that.
This commit is contained in:
parent
fed931afda
commit
8663f4bbaf
@ -393,10 +393,13 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
|
||||
|
||||
if (strlen_P(pstr) > LCD_WIDTH - 2 - strlen(value)) rows = 2;
|
||||
|
||||
u8g.setPrintPos( 0, u8g.getHeight() * 1/(1+rows) + DOG_CHAR_HEIGHT_EDIT/2); //1/(1+rows) = 1/2 or 1/3
|
||||
const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2;
|
||||
float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
|
||||
|
||||
u8g.setPrintPos(0, rowHeight + kHalfChar);
|
||||
lcd_printPGM(pstr);
|
||||
u8g.print(':');
|
||||
u8g.setPrintPos((lcd_width-1-strlen(value))*char_width, u8g.getHeight()*rows/(1+rows) + DOG_CHAR_HEIGHT_EDIT/2); //rows/(1+rows) = 1/2 or 2/3
|
||||
u8g.setPrintPos((lcd_width-1-strlen(value)) * char_width, rows * rowHeight + kHalfChar);
|
||||
u8g.print(value);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user