From 1241eb3db2d1b08be95d26fefe5516e5aba3b361 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 21 Mar 2022 23:51:44 +0100 Subject: [PATCH] Add a note on DPI scaling with vizia PeakMeter --- nih_plug_vizia/src/widgets/peak_meter.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nih_plug_vizia/src/widgets/peak_meter.rs b/nih_plug_vizia/src/widgets/peak_meter.rs index 57e6aec9..c4656384 100644 --- a/nih_plug_vizia/src/widgets/peak_meter.rs +++ b/nih_plug_vizia/src/widgets/peak_meter.rs @@ -207,6 +207,10 @@ where let bar_bounds = bounds.shrink(border_width / 2.0); let bar_ticks_start_x = bar_bounds.left().floor() as i32; let bar_ticks_end_x = bar_bounds.right().ceil() as i32; + // TODO: Right now this means that on higher DPI settings you'll end up with more, denser + // ticks. We can try keeping the number of ticks fixed, but I don't know how that + // would work with fractional scaling since we also want everything to stay aligned to + // the pixel grid. let bar_tick_coordinates = (bar_ticks_start_x..bar_ticks_end_x).step_by((TICK_WIDTH + TICK_GAP).round() as usize); for tick_x in bar_tick_coordinates {