From 23add146975cbfd19f1980e79420906e19ef26d7 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 22 Mar 2022 01:46:03 +0100 Subject: [PATCH] Also DPI scale the PeakMeter hold position --- nih_plug_vizia/src/widgets/peak_meter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nih_plug_vizia/src/widgets/peak_meter.rs b/nih_plug_vizia/src/widgets/peak_meter.rs index fc1960e5..0abe2f62 100644 --- a/nih_plug_vizia/src/widgets/peak_meter.rs +++ b/nih_plug_vizia/src/widgets/peak_meter.rs @@ -249,11 +249,11 @@ where // need to account for that. Otherwise the ticks will be 2px wide instead of 1px. let peak_x = db_to_x_coord(peak_dbfs); let mut path = Path::new(); - path.move_to(peak_x + 0.5, bar_bounds.top()); - path.line_to(peak_x + 0.5, bar_bounds.bottom()); + path.move_to(peak_x + (dpi_scale / 2.0), bar_bounds.top()); + path.line_to(peak_x + (dpi_scale / 2.0), bar_bounds.bottom()); let mut paint = Paint::color(femtovg::Color::rgbaf(0.3, 0.3, 0.3, opacity)); - paint.set_line_width(TICK_WIDTH); + paint.set_line_width(TICK_WIDTH * dpi_scale); canvas.stroke_path(&mut path, paint); }