From fbe3a97174943990eef874b0d91045857b851889 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Feb 2023 21:23:42 -0600 Subject: [PATCH] =?UTF-8?q?tweak,=20no=20"err=C2=B0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index d2150353de1fb..1d059241057de 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -192,18 +192,14 @@ #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, const uint8_t ty) { - const char *str; - uint8_t len; if (temp > 0) { - str = i16tostr3rj(temp); - len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1; + const char *str = i16tostr3left(temp); + uint8_t len = strlen(str); + lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, str); + lcd_put_lchar(LCD_STR_DEGREE[0]); } - else { - str = "err"; - len = 3; - } - lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]); - if (temp > 0) lcd_put_lchar(LCD_STR_DEGREE[0]); + else + lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, F("err")); } #if DO_DRAW_FLOWMETER