From 2fc0df1b392e9dc8c89f77b64fd64865785e24d5 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Mon, 16 Mar 2020 20:11:55 +0100 Subject: [PATCH] Shorter LCD remaining time to prevent overlap (#17181) --- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 92f935f04..be414ab30 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -448,10 +448,10 @@ void MarlinUI::draw_status_screen() { #endif } + constexpr bool can_show_days = DISABLED(DOGM_SD_PERCENT) || ENABLED(ROTATE_PROGRESS_DISPLAY); if (ev != lastElapsed) { lastElapsed = ev; - const bool has_days = (elapsed.value >= 60*60*24L); - const uint8_t len = elapsed.toDigital(elapsed_string, has_days); + const uint8_t len = elapsed.toDigital(elapsed_string, can_show_days && elapsed.value >= 60*60*24L); elapsed_x_pos = _SD_INFO_X(len); #if ENABLED(SHOW_REMAINING_TIME) @@ -468,8 +468,7 @@ void MarlinUI::draw_status_screen() { } else { duration_t estimation = timeval; - const bool has_days = (estimation.value >= 60*60*24L); - const uint8_t len = estimation.toDigital(estimation_string, has_days); + const uint8_t len = estimation.toDigital(estimation_string, can_show_days && estimation.value >= 60*60*24L); estimation_x_pos = _SD_INFO_X(len #if !BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY) + 1