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.
This commit is contained in:
endym 2024-08-12 12:21:36 +02:00
parent b83cedfcae
commit dd9841086c

View file

@ -471,10 +471,10 @@ int Display::update_out_buf_() {
is_get_next_char = false; is_get_next_char = false;
if (is_point_seg_only(pos_char)) { // is point segment only? 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 (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 - 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? 2])) { // previous text character wasn't a point?
if (pos == 0) { // 1st (most left) display position? if (pos == 0) { // 1st (most left) display position?
is_get_next_char = true; // yes -> ignore point, get next character is_get_next_char = true; // yes -> ignore point, get next character
} else { } else {
--pos; // no -> add point to previous display position --pos; // no -> add point to previous display position
is_clear_pos = false; is_clear_pos = false;