fix: clamp bar values to width that is available

This commit is contained in:
Stevan Freeborn
2026-07-27 17:34:38 -05:00
parent e3edf57745
commit 714aebc2ed
+2
View File
@@ -446,8 +446,10 @@ impl Drop for AudioVisualizer {
fn render_visualizer(f: &mut Frame, area: Rect, bar_values: &[u64]) {
const BLOCKS: [&str; 8] = ["", "", "", "", "", "", "", ""];
let max_bars = area.width as usize;
let line: String = bar_values
.iter()
.take(max_bars)
.map(|&val| {
if val == 0 {
" "