This commit is contained in:
i do not exist 2026-06-19 20:23:53 +03:00
parent b44dc635ef
commit 80fe958476
8 changed files with 69 additions and 45 deletions

View file

@ -596,8 +596,9 @@ fn draw_list_item (sample: &Option<Arc<RwLock<Sample>>>) -> String {
fn draw_viewer (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui> + use<'_> {
let min_db = -64.0;
Thunk::new(move|to: &mut Tui|{
let XYWH(x, y, width, height) = to.area();
thunk(move|to: &mut Tui|{
let xywh = to.area().into();
let XYWH(x, y, width, height) = xywh;
let area = Rect { x, y, width, height };
if let Some(sample) = &sample {
let sample = sample.read().unwrap();
@ -631,7 +632,8 @@ fn draw_viewer (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui> + use<'_
//height as f64 / 2.0,
//text.red()
//);
}).render(area, &mut to.1);
})
.render(area, to.as_mut());
} else {
Canvas::default()
.x_bounds([0.0, width as f64])
@ -644,8 +646,9 @@ fn draw_viewer (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui> + use<'_
//text.red()
//);
})
.render(area, &mut to.1);
.render(area, to.as_mut());
}
Ok(xywh)
})
}