fix status bar (ran out of precision during the floating pt refactoring)

This commit is contained in:
bunnie 2022-06-27 04:25:18 +08:00
parent e2b550f34d
commit ac3f6a06fb

View file

@ -530,7 +530,7 @@ fn wrapped_main() -> ! {
let (latest_activity, period) = llio
.activity_instantaneous()
.expect("couldn't get CPU activity");
let activity_to_width = (((latest_activity * 1000) / (period)) * (cpuload_rect.width() - 4) as u32) / 1000;
let activity_to_width = ((latest_activity as u64) * 1000u64 * (cpuload_rect.width() as u64 - 4)) / (period as u64 * 1000u64);
draw_list.push(GamObjectType::Rect(
Rectangle::new_coords_with_style(
cpuload_rect.tl().x + 2,