diff --git a/nih_plug_egui/src/lib.rs b/nih_plug_egui/src/lib.rs index 5ab69e24..01df87fc 100644 --- a/nih_plug_egui/src/lib.rs +++ b/nih_plug_egui/src/lib.rs @@ -44,7 +44,13 @@ where user_state: Arc::new(RwLock::new(user_state)), update: Arc::new(update), + // TODO: We can't get the size of the window when baseview does its own scaling, so if the + // host does not set a scale factor on Windows or Linux we should just use a factor of + // 1. That may make the GUI tiny but it also prevents it from getting cut off. + #[cfg(target_os = "macos")] scaling_factor: AtomicCell::new(None), + #[cfg(not(target_os = "macos"))] + scaling_factor: AtomicCell::new(Some(1.0)), })) } diff --git a/nih_plug_iced/src/lib.rs b/nih_plug_iced/src/lib.rs index d8f8e53d..6fb0366d 100644 --- a/nih_plug_iced/src/lib.rs +++ b/nih_plug_iced/src/lib.rs @@ -132,7 +132,13 @@ pub fn create_iced_editor( iced_state, initialization_flags, + // TODO: We can't get the size of the window when baseview does its own scaling, so if the + // host does not set a scale factor on Windows or Linux we should just use a factor of + // 1. That may make the GUI tiny but it also prevents it from getting cut off. + #[cfg(target_os = "macos")] scaling_factor: AtomicCell::new(None), + #[cfg(not(target_os = "macos"))] + scaling_factor: AtomicCell::new(Some(1.0)), parameter_updates_sender, parameter_updates_receiver: Arc::new(parameter_updates_receiver), diff --git a/nih_plug_vizia/src/lib.rs b/nih_plug_vizia/src/lib.rs index 39b6bf4d..a6a2de98 100644 --- a/nih_plug_vizia/src/lib.rs +++ b/nih_plug_vizia/src/lib.rs @@ -34,7 +34,13 @@ where app: Arc::new(app), apply_theming: true, + // TODO: We can't get the size of the window when baseview does its own scaling, so if the + // host does not set a scale factor on Windows or Linux we should just use a factor of + // 1. That may make the GUI tiny but it also prevents it from getting cut off. + #[cfg(target_os = "macos")] scaling_factor: AtomicCell::new(None), + #[cfg(not(target_os = "macos"))] + scaling_factor: AtomicCell::new(Some(1.0)), })) } @@ -54,7 +60,10 @@ where app: Arc::new(app), apply_theming: false, + #[cfg(target_os = "macos")] scaling_factor: AtomicCell::new(None), + #[cfg(not(target_os = "macos"))] + scaling_factor: AtomicCell::new(Some(1.0)), })) }