mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-10 14:44:18 +00: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
2 changed files with 15 additions and 2 deletions
|
@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## 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
|
||||
|
||||
## Changes
|
||||
|
|
|
@ -199,9 +199,16 @@ impl CpuGraphWidget for Painter {
|
|||
})
|
||||
.style(if show_avg_cpu && itx == AVG_POSITION {
|
||||
self.colours.avg_colour_style
|
||||
} else if itx == ALL_POSITION {
|
||||
self.colours.all_colour_style
|
||||
} else {
|
||||
self.colours.cpu_colour_styles
|
||||
[itx % self.colours.cpu_colour_styles.len()]
|
||||
self.colours.cpu_colour_styles[(itx - 1 // Because of the all position
|
||||
- (if show_avg_cpu {
|
||||
AVG_POSITION
|
||||
} else {
|
||||
0
|
||||
}))
|
||||
% self.colours.cpu_colour_styles.len()]
|
||||
})
|
||||
.data(&cpu.cpu_data[..])
|
||||
.graph_type(tui::widgets::GraphType::Line)
|
||||
|
|
Loading…
Reference in a new issue