mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-22 04:03:06 +00:00
fix: add extra row for basic cpu widget if using avg row on cores % 4 != 0 (#1565)
This commit is contained in:
parent
5a009987ac
commit
cbe27997bd
1 changed files with 6 additions and 2 deletions
|
@ -356,8 +356,12 @@ impl Painter {
|
||||||
// This fixes #397, apparently if the height is 1, it can't render the CPU
|
// This fixes #397, apparently if the height is 1, it can't render the CPU
|
||||||
// bars...
|
// bars...
|
||||||
let cpu_height = {
|
let cpu_height = {
|
||||||
let c =
|
let c = (actual_cpu_data_len / 4) as u16
|
||||||
(actual_cpu_data_len / 4) as u16 + u16::from(actual_cpu_data_len % 4 != 0);
|
+ 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 {
|
if c <= 1 {
|
||||||
1
|
1
|
||||||
|
|
Loading…
Reference in a new issue