1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 20:18:52 +00:00

Adjustment to DOG_CHAR_*_EDIT

This commit is contained in:
Scott Lahteine 2018-02-05 20:15:35 -06:00
parent 8a6feab1c4
commit 38d62494ef

View File

@ -143,13 +143,11 @@
#if ENABLED(USE_BIG_EDIT_FONT)
#define FONT_MENU_EDIT_NAME u8g_font_9x18
#define DOG_CHAR_WIDTH_EDIT 9
#define DOG_CHAR_HEIGHT_EDIT 13
#define LCD_WIDTH_EDIT 14
#define DOG_CHAR_HEIGHT_EDIT 18
#else
#define FONT_MENU_EDIT_NAME FONT_MENU_NAME
#define DOG_CHAR_WIDTH_EDIT 6
#define DOG_CHAR_HEIGHT_EDIT 12
#define LCD_WIDTH_EDIT 22
#define DOG_CHAR_WIDTH_EDIT DOG_CHAR_WIDTH
#define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT
#endif
#ifndef TALL_FONT_CORRECTION
@ -935,13 +933,15 @@ static void lcd_implementation_status_screen() {
const uint8_t labellen = lcd_strlen_P(pstr),
vallen = lcd_strlen(value);
constexpr uint8_t lcd_width_edit = (LCD_WIDTH) / (DOG_CHAR_WIDTH_EDIT);
uint8_t rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1;
#if ENABLED(USE_BIG_EDIT_FONT)
uint8_t lcd_width, char_width;
if (labellen <= LCD_WIDTH_EDIT - 1) {
if (labellen + vallen + 2 >= LCD_WIDTH_EDIT) rows = 2;
lcd_width = LCD_WIDTH_EDIT + 1;
if (labellen <= lcd_width_edit - 1) {
if (labellen + vallen + 2 >= lcd_width_edit) rows = 2;
lcd_width = lcd_width_edit + 1;
char_width = DOG_CHAR_WIDTH_EDIT;
lcd_setFont(FONT_MENU_EDIT);
}