Skip to content

Commit

Permalink
fix: add extra row for basic cpu widget if using avg row on cores % 4…
Browse files Browse the repository at this point in the history
… != 0 (#1565)
  • Loading branch information
zebp committed Aug 19, 2024
1 parent 5a00998 commit cbe2799
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbe2799

Please sign in to comment.