From 52a8bbefcf6ce6b5869c740c88662acd5292706b Mon Sep 17 00:00:00 2001 From: Robby Candra Date: Sun, 20 Oct 2019 23:44:05 +0700 Subject: [PATCH] Make sure estimate time = 0 not displayed --- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 752413a68c..591d0f08ad 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -432,13 +432,19 @@ void MarlinUI::draw_status_screen() { #if ENABLED(SHOW_REMAINING_TIME) if (!(ev & 0x3)) { duration_t estimation = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress; - const bool has_days = (estimation.value >= 60*60*24L); - const uint8_t len = estimation.toDigital(estimation_string, has_days); - #if ENABLED(DOGM_SD_PERCENT) && ENABLED(ROTATE_PROGRESS_DISPLAY) - estimation_x_pos = _SD_DURATION_X(len); - #else - estimation_x_pos = _SD_DURATION_X(len + 1); - #endif + if (estimation.value == 0) { + estimation_string[0] = '\0'; + estimation_x_pos = _PROGRESS_CENTER_X(0); + } + else { + const bool has_days = (estimation.value >= 60*60*24L); + const uint8_t len = estimation.toDigital(estimation_string, has_days); + #if ENABLED(DOGM_SD_PERCENT) && ENABLED(ROTATE_PROGRESS_DISPLAY) + estimation_x_pos = _SD_DURATION_X(len); + #else + estimation_x_pos = _SD_DURATION_X(len + 1); + #endif + } } #endif }