From 5f47c6e255a3e5f166cb84b25be5394fb6a884db Mon Sep 17 00:00:00 2001 From: Michael Davidson Date: Sat, 30 Dec 2023 11:07:47 +1100 Subject: [PATCH] Test, clang-format, and ci-custom fixes --- esphome/components/graphical_layout/text_run_panel.cpp | 8 ++++---- tests/test1.yaml | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/esphome/components/graphical_layout/text_run_panel.cpp b/esphome/components/graphical_layout/text_run_panel.cpp index d1c9ba5960..2199ee3262 100644 --- a/esphome/components/graphical_layout/text_run_panel.cpp +++ b/esphome/components/graphical_layout/text_run_panel.cpp @@ -41,7 +41,7 @@ display::Rect TextRunPanel::measure_item_internal(display::Display *display) { void TextRunPanel::render_internal(display::Display *display, display::Rect bounds) { CalculatedLayout layout = this->determine_layout(display, bounds, true); - for (const auto& calculated : layout.runs) { + for (const auto &calculated : layout.runs) { if (calculated->run->background_color_ != display::COLOR_OFF) { display->filled_rectangle(calculated->bounds.x, calculated->bounds.y, calculated->bounds.w, calculated->bounds.h, calculated->run->background_color_); @@ -52,7 +52,7 @@ void TextRunPanel::render_internal(display::Display *display, display::Rect boun if (this->debug_outline_runs_) { ESP_LOGD(TAG, "Outlining character runs"); - for (const auto& calculated : layout.runs) { + for (const auto &calculated : layout.runs) { display->rectangle(calculated->bounds.x, calculated->bounds.y, calculated->bounds.w, calculated->bounds.h); } } @@ -185,7 +185,7 @@ void TextRunPanel::apply_alignment_to_layout(CalculatedLayout *calculated_layout std::vector> line_runs; // Get all the runs for the current line - for (const auto& run : calculated_layout->runs) { + for (const auto &run : calculated_layout->runs) { if (run->line_number_ == i) { line_runs.push_back(run); } @@ -224,7 +224,7 @@ void TextRunPanel::apply_alignment_to_layout(CalculatedLayout *calculated_layout } int max_line_y_adjustment = 0; - for (const auto& run : line_runs) { + for (const auto &run : line_runs) { ESP_LOGVV(TAG, "Adjusting '%s' from (%i, %i) to (%i, %i)", run->text_.c_str(), run->bounds.x, run->bounds.y, run->bounds.x + x_adjustment, run->bounds.y + y_adjustment); run->bounds.x += x_adjustment; diff --git a/tests/test1.yaml b/tests/test1.yaml index 86d70368cf..0e2fe41974 100644 --- a/tests/test1.yaml +++ b/tests/test1.yaml @@ -4351,7 +4351,8 @@ graphical_layout: lambda: |- it.filled_circle(25, 25, 10); - type: text_run_panel - texT_align: BASELINE_CENTER + text_align: BASELINE_CENTER + max_width: 100 runs: - font: roboto text: Hello @@ -4361,4 +4362,4 @@ graphical_layout: foreground_color: layout_white - font: roboto text: !lambda |- - return "Dynamic text"; \ No newline at end of file + return "Dynamic text";