mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-02-21 16:29:04 +01:00
This commit is contained in:
parent
82ff49b386
commit
2d7ca155e0
7 changed files with 38 additions and 29 deletions
|
|
@ -12,7 +12,7 @@ pub struct Log10Meter(pub f32);
|
|||
impl Layout<TuiOut> for Log10Meter {}
|
||||
impl Draw<TuiOut> for Log10Meter {
|
||||
fn draw (&self, to: &mut TuiOut) {
|
||||
let [x, y, w, h] = to.area();
|
||||
let XYWH(x, y, w, h) = to.area();
|
||||
let signal = 100.0 - f32::max(0.0, f32::min(100.0, self.0.abs()));
|
||||
let v = (signal * h as f32 / 100.0).ceil() as u16;
|
||||
let y2 = y + h;
|
||||
|
|
@ -36,7 +36,7 @@ pub struct RmsMeter(pub f32);
|
|||
impl Layout<TuiOut> for RmsMeter {}
|
||||
impl Draw<TuiOut> for RmsMeter {
|
||||
fn draw (&self, to: &mut TuiOut) {
|
||||
let [x, y, w, h] = to.area();
|
||||
let XYWH(x, y, w, h) = to.area();
|
||||
let signal = f32::max(0.0, f32::min(100.0, self.0.abs()));
|
||||
let v = (signal * h as f32).ceil() as u16;
|
||||
let y2 = y + h;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue