Update Vizia

This commit is contained in:
Robbert van der Helm
2023-02-23 18:41:32 +01:00
parent debb2662af
commit ed6f5d881c
4 changed files with 231 additions and 196 deletions

View File

@@ -17,5 +17,6 @@ crossbeam = "0.8"
serde = { version = "1.0", features = ["derive"] }
# This fork contains some additional patches on top of Vizia to make it more
# suitable for use in NIH-plug. The set of patches constantly changes as things
# are merged into upstream Vizia.
# are merged into upstream Vizia. This also excludes the `embedded_fonts`
# feature.
vizia = { git = "https://github.com/robbert-vdh/vizia.git", branch = "patched", default_features = false, features = ["baseview", "clipboard", "x11"] }

View File

@@ -5,6 +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::context::backend::TextConfig;
use vizia::prelude::*;
use crate::widgets::RawParamEvent;
@@ -81,6 +82,10 @@ impl Editor for ViziaEditor {
)
.inner_size((unscaled_width, unscaled_height))
.user_scale_factor(user_scale_factor)
.with_text_config(TextConfig {
hint: false,
subpixel: true,
})
.on_idle({
let emit_parameters_changed_event = self.emit_parameters_changed_event.clone();
move |cx| {

View File

@@ -43,7 +43,7 @@ impl View for ResizeHandle {
fn event(&mut self, cx: &mut EventContext, event: &mut Event) {
event.map(|window_event, meta| match *window_event {
WindowEvent::MouseDown(MouseButton::Left) => {
// The handle is a triangle, so we should also interac twith it as if it was a
// The handle is a triangle, so we should also interact with it as if it was a
// triangle
if intersects_triangle(
cx.cache.get_bounds(cx.current()),