From e53db181d2e1292f7572ef02770756b0cc2f9c72 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Tue, 11 Aug 2020 09:04:23 -0500 Subject: [PATCH] a-comp, a-exp: threshold should be referenced to the input (bottom) axis --- libs/plugins/a-comp.lv2/a-comp.c | 6 +++--- libs/plugins/a-exp.lv2/a-exp.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/plugins/a-comp.lv2/a-comp.c b/libs/plugins/a-comp.lv2/a-comp.c index 0acea93d0e..f5833aae2e 100644 --- a/libs/plugins/a-comp.lv2/a-comp.c +++ b/libs/plugins/a-comp.lv2/a-comp.c @@ -529,9 +529,9 @@ render_inline_full (cairo_t* cr, const AComp* self) draw_grid (cr, w,h); if (self->v_thresdb < 0) { - const float y = -.5 + floorf (h * ((makeup_thres - 10.f) / -70.f)); - cairo_move_to (cr, 0, y); - cairo_line_to (cr, w, y); + const float x = w * (1.f - (10.f-self->v_thresdb)/70.f) + 0.5; + cairo_move_to (cr, x, 0); + cairo_line_to (cr, x, h); cairo_stroke (cr); } diff --git a/libs/plugins/a-exp.lv2/a-exp.c b/libs/plugins/a-exp.lv2/a-exp.c index 0fb8b93b8e..590e9d19c9 100644 --- a/libs/plugins/a-exp.lv2/a-exp.c +++ b/libs/plugins/a-exp.lv2/a-exp.c @@ -532,9 +532,9 @@ render_inline_full (cairo_t* cr, const AExp* self) draw_grid (cr, w,h); if (self->v_thresdb < 0) { - const float y = -.5 + floorf (h * ((makeup_thres - 10.f) / -70.f)); - cairo_move_to (cr, 0, y); - cairo_line_to (cr, w, y); + const float x = w * (1.f - (10.f-self->v_thresdb)/70.f) + 0.5; + cairo_move_to (cr, x, 0); + cairo_line_to (cr, x, h); cairo_stroke (cr); }