From f18868be796d7c0e12dce2639efc3eb3468df118 Mon Sep 17 00:00:00 2001 From: "Andrew J.Swan" Date: Mon, 25 Dec 2023 18:56:30 +0200 Subject: [PATCH 1/2] 2023.9.1: Move icon text to right in Icon to 9 mode 3 Day Mode 5 and Day < 10 If Weekday array == 7 --- components/ehmtxv2/EHMTX_queue.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index 38cc7eda..284ce6ec 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -725,7 +725,14 @@ namespace esphome } if (mode == 5 && (d < 10)) { - x_right = 4 - (r_width - 1) / 2; + if (this->config_->icon_to_9 == 3) + { + x_right = 5 - (r_width - 1) / 2; + } + else + { + x_right = 4 - (r_width - 1) / 2; + } this->config_->display->printf(x_right, this->ypos() + yoffset + i_y_offset, info_font, i_rcolor, display::TextAlign::BASELINE_LEFT, "%d", d % 10); } else @@ -777,7 +784,14 @@ namespace esphome // The symbol consists of a visible part, and an empty area to the right with a width of one point. uint8_t c_width = this->config_->GetTextWidth(info_font, "%s", weekday.c_str()); - x_left = 4 - (c_width - 1) / 2; + if (this->config_->icon_to_9 == 3) + { + x_left = 5 - (c_width - 1) / 2; + } + else + { + x_left = 4 - (c_width - 1) / 2; + } this->config_->display->printf(x_left, this->ypos() + yoffset + i_y_offset, info_font, i_lcolor, display::TextAlign::BASELINE_LEFT, "%s", weekday.c_str()); } } From b49f4334fa7c9735933cbe24a2d298c4e8969152 Mon Sep 17 00:00:00 2001 From: "Andrew J.Swan" Date: Mon, 25 Dec 2023 19:15:29 +0200 Subject: [PATCH 2/2] 2023.9.1: Advanced clock fix for Icon to 9 mode 3 --- components/ehmtxv2/EHMTX_queue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index 284ce6ec..5cd4ced6 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -619,7 +619,7 @@ namespace esphome if (this->mode == MODE_ICON_CLOCK) { #ifdef EHMTXv2_ADV_CLOCK - if (!this->config_->draw_clock(EHMTXv2_TIME_FORMAT, font, color_, xoffset + 20, this->ypos() + yoffset)) + if (!this->config_->draw_clock(EHMTXv2_TIME_FORMAT, font, color_, xoffset + offset, this->ypos() + yoffset)) { #endif if (this->config_->replace_time_date_active) // check for replace active