fix: add extra row for basic cpu widget if using avg row on cores % 4 != 0 (#1565)

This commit is contained in:
Zeb Piasecki 2024-08-19 10:51:03 -04:00 committed by GitHub
parent 5a009987ac
commit cbe27997bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -356,8 +356,12 @@ impl Painter {
// This fixes #397, apparently if the height is 1, it can't render the CPU
// bars...
let cpu_height = {
let c =
(actual_cpu_data_len / 4) as u16 + u16::from(actual_cpu_data_len % 4 != 0);
let c = (actual_cpu_data_len / 4) as u16
+ u16::from(actual_cpu_data_len % 4 != 0)
+ u16::from(
app_state.app_config_fields.dedicated_average_row
&& actual_cpu_data_len.saturating_sub(1) % 4 != 0,
);
if c <= 1 {
1