From a2975ecdc9014c5dc2666812f66e10e679a40dc3 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Tue, 3 Nov 2020 22:10:57 +0200 Subject: Draw RAM bar ending char only if bar is not full --- src/components/kernel.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/kernel.rs b/src/components/kernel.rs index d072518..b3ddacb 100644 --- a/src/components/kernel.rs +++ b/src/components/kernel.rs @@ -295,15 +295,17 @@ impl KernelMetrics { None, ); } - write_string_to_grid( - "▕", - grid, - Color::Byte(240), - Color::Default, - Attr::Default, - (pos_inc(upper_left, (bars_max + 2, y_offset)), bottom_right), - None, - ); + if available_length > 0 { + write_string_to_grid( + "▕", + grid, + Color::Byte(240), + Color::Default, + Attr::Default, + (pos_inc(upper_left, (bars_max + 2, y_offset)), bottom_right), + None, + ); + } write_string_to_grid( &mem_display, grid, -- cgit v1.2.3