This commit is contained in:
2026-04-18 07:48:05 +02:00
parent 20b9a95619
commit 34a41ad25c
22 changed files with 97 additions and 79 deletions

View File

@@ -430,8 +430,7 @@ void Menu::setSelectorPos(int index) {
// Obtiene la anchura del elemento más ancho del menu
int Menu::getWidestItem() {
return std::accumulate(item.begin(), item.end(), 0,
[](int acc, const item_t &i) { return std::max(acc, i.rect.w); });
return std::accumulate(item.begin(), item.end(), 0, [](int acc, const item_t &i) { return std::max(acc, i.rect.w); });
}
// Deja el menu apuntando al primer elemento
@@ -792,8 +791,7 @@ int Menu::findWidth() {
// Calcula el alto del menu
int Menu::findHeight() {
const int height = std::accumulate(item.begin(), item.end(), 0,
[](int acc, const item_t &i) { return acc + i.rect.h + i.hPaddingDown; });
const int height = std::accumulate(item.begin(), item.end(), 0, [](int acc, const item_t &i) { return acc + i.rect.h + i.hPaddingDown; });
return height - item.back().hPaddingDown;
}