mirror of
https://github.com/esphome/esphome.git
synced 2025-10-08 12:53:45 +01:00
[graphical_display_menu] Fix clang-tidy sign comparison errors (#11052)
This commit is contained in:
@@ -116,7 +116,7 @@ void GraphicalDisplayMenu::draw_menu_internal_(display::Display *display, const
|
||||
int number_items_fit_to_screen = 0;
|
||||
const int max_item_index = this->displayed_item_->items_size() - 1;
|
||||
|
||||
for (size_t i = 0; i <= max_item_index; i++) {
|
||||
for (size_t i = 0; max_item_index >= 0 && i <= static_cast<size_t>(max_item_index); i++) {
|
||||
const auto *item = this->displayed_item_->get_item(i);
|
||||
const bool selected = i == this->cursor_index_;
|
||||
const display::Rect item_dimensions = this->measure_item(display, item, bounds, selected);
|
||||
@@ -174,7 +174,8 @@ void GraphicalDisplayMenu::draw_menu_internal_(display::Display *display, const
|
||||
|
||||
display->filled_rectangle(bounds->x, bounds->y, max_width, total_height, this->background_color_);
|
||||
auto y_offset = bounds->y;
|
||||
for (size_t i = first_item_index; i <= last_item_index; i++) {
|
||||
for (size_t i = static_cast<size_t>(first_item_index);
|
||||
last_item_index >= 0 && i <= static_cast<size_t>(last_item_index); i++) {
|
||||
const auto *item = this->displayed_item_->get_item(i);
|
||||
const bool selected = i == this->cursor_index_;
|
||||
display::Rect dimensions = menu_dimensions[i];
|
||||
|
Reference in New Issue
Block a user