mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Prevent HiDPI scale changes after opening editor
Ableton Live does this and it caused mysterious issues where the window could suddenly be larger than the window's contents when resizing on a HiDPI setup.
This commit is contained in:
@@ -97,6 +97,12 @@ impl<E: IcedEditor> Editor for IcedEditorWrapper<E> {
|
||||
}
|
||||
|
||||
fn set_scale_factor(&self, factor: f32) -> bool {
|
||||
// If the editor is currently open then the host must not change the current HiDPI scale as
|
||||
// we don't have a way to handle that. Ableton Live does this.
|
||||
if self.iced_state.is_open() {
|
||||
return false;
|
||||
}
|
||||
|
||||
self.scaling_factor.store(Some(factor));
|
||||
true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user