From dd9841086c7c82c6e8adc5b8e7bdb3eeb1cc8f80 Mon Sep 17 00:00:00 2001 From: endym Date: Mon, 12 Aug 2024 12:21:36 +0200 Subject: [PATCH] MAX6921: fix handling of points within text A point (or comma) after a character should activate the display point segment of appropriate character and not using an extra display position. --- esphome/components/max6921/display.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esphome/components/max6921/display.cpp b/esphome/components/max6921/display.cpp index 3580e4c536..be0c495bf4 100644 --- a/esphome/components/max6921/display.cpp +++ b/esphome/components/max6921/display.cpp @@ -471,10 +471,10 @@ int Display::update_out_buf_() { is_get_next_char = false; if (is_point_seg_only(pos_char)) { // is point segment only? if (this->disp_text_.visible_idx + visible_idx_offset - 1 > 0) { // not the 1st text character? - if (is_point_seg_only(this->disp_text_.text[this->disp_text_.visible_idx + visible_idx_offset - - 2])) { // previous text character wasn't a point? - if (pos == 0) { // 1st (most left) display position? - is_get_next_char = true; // yes -> ignore point, get next character + if (!is_point_seg_only(this->disp_text_.text[this->disp_text_.visible_idx + visible_idx_offset - + 2])) { // previous text character wasn't a point? + if (pos == 0) { // 1st (most left) display position? + is_get_next_char = true; // yes -> ignore point, get next character } else { --pos; // no -> add point to previous display position is_clear_pos = false;