浏览代码

Make sure estimate time = 0 not displayed

Robby Candra 5 年前
父节点
当前提交
52a8bbefcf
共有 1 个文件被更改,包括 13 次插入7 次删除
  1. 13
    7
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp

+ 13
- 7
Marlin/src/lcd/dogm/status_screen_DOGM.cpp 查看文件

@@ -432,13 +432,19 @@ void MarlinUI::draw_status_screen() {
432 432
         #if ENABLED(SHOW_REMAINING_TIME)
433 433
           if (!(ev & 0x3)) {
434 434
             duration_t estimation = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
435
-            const bool has_days = (estimation.value >= 60*60*24L);
436
-            const uint8_t len = estimation.toDigital(estimation_string, has_days);
437
-            #if ENABLED(DOGM_SD_PERCENT) && ENABLED(ROTATE_PROGRESS_DISPLAY)
438
-              estimation_x_pos = _SD_DURATION_X(len);
439
-            #else
440
-              estimation_x_pos = _SD_DURATION_X(len + 1);
441
-            #endif
435
+            if (estimation.value == 0) {
436
+              estimation_string[0] = '\0';
437
+              estimation_x_pos = _PROGRESS_CENTER_X(0);
438
+            }
439
+            else {
440
+              const bool has_days = (estimation.value >= 60*60*24L);
441
+              const uint8_t len = estimation.toDigital(estimation_string, has_days);
442
+              #if ENABLED(DOGM_SD_PERCENT) && ENABLED(ROTATE_PROGRESS_DISPLAY)
443
+                estimation_x_pos = _SD_DURATION_X(len);
444
+              #else
445
+                estimation_x_pos = _SD_DURATION_X(len + 1);
446
+              #endif
447
+            }
442 448
           }
443 449
         #endif
444 450
       }

正在加载...
取消
保存