From a75494b7fa0c8ba09eabe30eb44bbb458575f011 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Wed, 29 Apr 2020 08:58:59 +0200 Subject: [PATCH] Fixed display bar. --- UI.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UI.hpp b/UI.hpp index 5e8bc12..14585e8 100644 --- a/UI.hpp +++ b/UI.hpp @@ -4530,15 +4530,17 @@ void lcd_display_bar_float(const char* title, float value, float factor, int32_t if (vi == 0) { lcd.write((uint8_t)vf / 2.0 - 0.5); - lcd.print(F(" ")); + for (uint8_t i = vi + 1; i < LCD_cols; i++) + lcd.print(F(" ")); // empty block } else { + for (uint8_t i = 0; i < vi; i++) lcd.write((uint8_t)4); // full block if (vi < LCD_cols) lcd.write((uint8_t)vf / 2.0 - 0.5); - for (uint8_t i = LCD_cols - vi; i < LCD_cols; i++) + for (uint8_t i = vi + 1; i < LCD_cols; i++) lcd.print(F(" ")); // empty block } }