Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Marlin/src/lcd/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,17 @@ millis_t next_button_update_ms;

void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) {
const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0;
uint8_t row = 0, col = 0;
uint8_t col = 0, row = 0;
if (!string && plen + slen <= LCD_WIDTH) {
row = (LCD_WIDTH - plen - slen) / 2;
col = LCD_HEIGHT > 3 ? 1 : 0;
col = (LCD_WIDTH - plen - slen) / 2;
row = LCD_HEIGHT > 3 ? 1 : 0;
}
wrap_string_P(row, col, pref, true);
wrap_string_P(col, row, pref, true);
if (string) {
if (row) { row = 0; col++; } // Move to the start of the next line
wrap_string(row, col, string);
if (col) { col = 0; row++; } // Move to the start of the next line
wrap_string(col, row, string);
}
if (suff) wrap_string_P(row, col, suff);
if (suff) wrap_string_P(col, row, suff);
}

#endif // HAS_LCD_MENU
Expand Down