From 3f384c0a5db78e4f622fdd7c4355a52c645f8eb2 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sat, 1 Jun 2024 14:09:49 +0200 Subject: [PATCH] Fixed missing CPU core temps when too small to show core temp graphs, issues #792 #867 --- src/btop_draw.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index 7d908a1..c54f634 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -824,10 +824,10 @@ namespace Cpu { out += Theme::g("cpu").at(clamp(safeVal(cpu.core_percent, n).back(), 0ll, 100ll)); out += rjust(to_string(safeVal(cpu.core_percent, n).back()), (b_column_size < 2 ? 3 : 4)) + Theme::c("main_fg") + '%'; - if (show_temps and not hide_cores and std::cmp_greater_equal(temp_graphs.size(), n)) { + if (show_temps and not hide_cores) { const auto [temp, unit] = celsius_to(safeVal(cpu.temp, n+1).back(), temp_scale); const auto& temp_color = Theme::g("temp").at(clamp(safeVal(cpu.temp, n+1).back() * 100 / cpu.temp_max, 0ll, 100ll)); - if (b_column_size > 1) + if (b_column_size > 1 and std::cmp_greater_equal(temp_graphs.size(), n)) out += ' ' + Theme::c("inactive_fg") + graph_bg * 5 + Mv::l(5) + temp_graphs.at(n+1)(safeVal(cpu.temp, n+1), data_same or redraw); out += temp_color + rjust(to_string(temp), 4) + Theme::c("main_fg") + unit;