From 482c8344504a0a5176209535abf4ac78e0e0f199 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 26 Apr 2022 14:45:06 +0200 Subject: [PATCH] Update Vizia fork --- Cargo.lock | 8 ++++---- nih_plug_vizia/src/lib.rs | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a5685377..57e4d678 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3498,7 +3498,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vizia" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#163ae29c603c51371a8a98cca3f4434f7bf38d37" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#44d6895c8a551771f7ed88add32bca435d68d879" dependencies = [ "vizia_baseview", "vizia_core", @@ -3507,7 +3507,7 @@ dependencies = [ [[package]] name = "vizia_baseview" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#163ae29c603c51371a8a98cca3f4434f7bf38d37" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#44d6895c8a551771f7ed88add32bca435d68d879" dependencies = [ "baseview 0.1.0 (git+https://github.com/robbert-vdh/baseview.git?branch=feature/resize)", "femtovg", @@ -3519,7 +3519,7 @@ dependencies = [ [[package]] name = "vizia_core" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#163ae29c603c51371a8a98cca3f4434f7bf38d37" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#44d6895c8a551771f7ed88add32bca435d68d879" dependencies = [ "bitflags", "copypasta", @@ -3544,7 +3544,7 @@ dependencies = [ [[package]] name = "vizia_derive" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#163ae29c603c51371a8a98cca3f4434f7bf38d37" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#44d6895c8a551771f7ed88add32bca435d68d879" dependencies = [ "proc-macro2", "quote", diff --git a/nih_plug_vizia/src/lib.rs b/nih_plug_vizia/src/lib.rs index 397ebf84..901bea41 100644 --- a/nih_plug_vizia/src/lib.rs +++ b/nih_plug_vizia/src/lib.rs @@ -5,7 +5,7 @@ use crossbeam::atomic::AtomicCell; use nih_plug::prelude::{Editor, GuiContext, ParentWindowHandle}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; -use vizia::{Application, Color, Context, Entity, Model, PropSet, WindowDescription}; +use vizia::{Application, Color, Context, Entity, Model, PropSet}; // Re-export for convenience pub use vizia; @@ -153,11 +153,8 @@ impl Editor for ViziaEditor { let (unscaled_width, unscaled_height) = vizia_state.inner_logical_size(); let system_scaling_factor = self.scaling_factor.load(); let user_scale_factor = vizia_state.user_scale_factor(); - let window_description = WindowDescription::new() - .with_inner_size(unscaled_width, unscaled_height) - .with_scale_factor(user_scale_factor); - let window = Application::new(window_description, move |cx| { + let window = Application::new(move |cx| { // Set some default styles to match the iced integration if apply_theming { // NOTE: vizia's font rendering looks way too dark and thick. Going one font weight @@ -199,6 +196,8 @@ impl Editor for ViziaEditor { .map(|factor| WindowScalePolicy::ScaleFactor(factor as f64)) .unwrap_or(WindowScalePolicy::SystemScaleFactor), ) + .inner_size((unscaled_width, unscaled_height)) + .user_scale_factor(user_scale_factor) .open_parented(&parent); self.vizia_state.open.store(true, Ordering::Release);