1
0
Fork 0

Update Vizia param base for upstream changes

This commit is contained in:
Robbert van der Helm 2023-11-14 22:47:00 +01:00
parent eb70aa2892
commit 3a0f3140b8

View file

@ -42,14 +42,19 @@ where
FMap: Fn(&Params) -> &P + Copy + 'static, FMap: Fn(&Params) -> &P + Copy + 'static,
{ {
fn clone(&self) -> Self { fn clone(&self) -> Self {
Self { *self
param: self.param,
params: self.params.clone(),
params_to_param: self.params_to_param,
}
} }
} }
impl<L, Params, P, FMap> Copy for ParamWidgetData<L, Params, P, FMap>
where
L: Lens<Target = Params> + Copy,
Params: 'static,
P: Param + 'static,
FMap: Fn(&Params) -> &P + Copy + 'static,
{
}
impl<L, Params, P, FMap> ParamWidgetData<L, Params, P, FMap> impl<L, Params, P, FMap> ParamWidgetData<L, Params, P, FMap>
where where
L: Lens<Target = Params> + Clone, L: Lens<Target = Params> + Clone,
@ -72,7 +77,7 @@ where
{ {
let params_to_param = self.params_to_param; let params_to_param = self.params_to_param;
self.params.clone().map(move |params| { self.params.map(move |params| {
let param = params_to_param(params); let param = params_to_param(params);
f(param) f(param)
}) })
@ -136,7 +141,6 @@ impl ParamWidgetBase {
// outlive the editor // outlive the editor
let param: &P = unsafe { let param: &P = unsafe {
&*params &*params
.clone()
.map(move |params| params_to_param(params) as *const P) .map(move |params| params_to_param(params) as *const P)
.get(cx) .get(cx)
}; };