mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-28 08:04:27 +02:00
bug: Fix incorrect cpu colour matching again in all position (#349)
Turns out there was yet another bug with the CPU colour allocation. I had forgotten to use the same index calculation for the "all" position.
This commit is contained in:
parent
74f4b386d7
commit
86135e466c
@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
|
|
||||||
|
## [0.5.5] - Unreleased
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
|
||||||
|
- [#349](https://github.com/ClementTsang/bottom/pull/349): Fixed CPU graph colours not matching the legend in the "all" state.
|
||||||
|
|
||||||
## [0.5.4] - 2020-12-10
|
## [0.5.4] - 2020-12-10
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
|
@ -199,9 +199,16 @@ impl CpuGraphWidget for Painter {
|
|||||||
})
|
})
|
||||||
.style(if show_avg_cpu && itx == AVG_POSITION {
|
.style(if show_avg_cpu && itx == AVG_POSITION {
|
||||||
self.colours.avg_colour_style
|
self.colours.avg_colour_style
|
||||||
|
} else if itx == ALL_POSITION {
|
||||||
|
self.colours.all_colour_style
|
||||||
} else {
|
} else {
|
||||||
self.colours.cpu_colour_styles
|
self.colours.cpu_colour_styles[(itx - 1 // Because of the all position
|
||||||
[itx % self.colours.cpu_colour_styles.len()]
|
- (if show_avg_cpu {
|
||||||
|
AVG_POSITION
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
}))
|
||||||
|
% self.colours.cpu_colour_styles.len()]
|
||||||
})
|
})
|
||||||
.data(&cpu.cpu_data[..])
|
.data(&cpu.cpu_data[..])
|
||||||
.graph_type(tui::widgets::GraphType::Line)
|
.graph_type(tui::widgets::GraphType::Line)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user