mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-08-07 22:17:07 +02:00
This commit is contained in:
parent
8de62463c0
commit
a938b68980
5 changed files with 262 additions and 336 deletions
|
|
@ -279,35 +279,39 @@ fn draw_viewer (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui> + use<'_
|
|||
lines.push(Line::new(x, min_db, x, y, Color::Green));
|
||||
t += step / 2.;
|
||||
}
|
||||
Canvas::default()
|
||||
.x_bounds([sample.start as f64, sample.end as f64])
|
||||
.y_bounds([min_db, 0.])
|
||||
.paint(|ctx| {
|
||||
for line in lines.iter() {
|
||||
ctx.draw(line);
|
||||
}
|
||||
//FIXME: proportions
|
||||
//let text = "press record to finish sampling";
|
||||
//ctx.print(
|
||||
//(width - text.len() as u16) as f64 / 2.0,
|
||||
//height as f64 / 2.0,
|
||||
//text.red()
|
||||
//);
|
||||
})
|
||||
.render(area, to.as_mut());
|
||||
if let Tui::Draw(buf, ..) = to {
|
||||
Canvas::default()
|
||||
.x_bounds([sample.start as f64, sample.end as f64])
|
||||
.y_bounds([min_db, 0.])
|
||||
.paint(|ctx| {
|
||||
for line in lines.iter() {
|
||||
ctx.draw(line);
|
||||
}
|
||||
//FIXME: proportions
|
||||
//let text = "press record to finish sampling";
|
||||
//ctx.print(
|
||||
//(width - text.len() as u16) as f64 / 2.0,
|
||||
//height as f64 / 2.0,
|
||||
//text.red()
|
||||
//);
|
||||
})
|
||||
.render(area, buf);
|
||||
}
|
||||
} else {
|
||||
Canvas::default()
|
||||
.x_bounds([0.0, width as f64])
|
||||
.y_bounds([0.0, height as f64])
|
||||
.paint(|_ctx| {
|
||||
//let text = "press record to begin sampling";
|
||||
//ctx.print(
|
||||
//(width - text.len() as u16) as f64 / 2.0,
|
||||
//height as f64 / 2.0,
|
||||
//text.red()
|
||||
//);
|
||||
})
|
||||
.render(area, to.as_mut());
|
||||
if let Tui::Draw(buf, ..) = to {
|
||||
Canvas::default()
|
||||
.x_bounds([0.0, width as f64])
|
||||
.y_bounds([0.0, height as f64])
|
||||
.paint(|_ctx| {
|
||||
//let text = "press record to begin sampling";
|
||||
//ctx.print(
|
||||
//(width - text.len() as u16) as f64 / 2.0,
|
||||
//height as f64 / 2.0,
|
||||
//text.red()
|
||||
//);
|
||||
})
|
||||
.render(area, buf);
|
||||
}
|
||||
}
|
||||
Ok(Some(xywh))
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue