mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 11:28:30 +08:00
Adapt the cutover to the reviewed core-types API
This commit is contained in:
22
test.rs
Normal file
22
test.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
trait Attr {
|
||||
fn name() -> &'static str
|
||||
}
|
||||
|
||||
impl Attr for bool {
|
||||
fn name() {"condition"}
|
||||
}
|
||||
|
||||
struct Opacity(f64);
|
||||
|
||||
impl Attr for Opacity {
|
||||
fn name() {"opacity"}
|
||||
}
|
||||
|
||||
|
||||
#[node]
|
||||
fn opacity<T>(_: impl Ctx, input: T, x: ReadAttr<bool>, opacity: WriteAttr<Opacity>) -> T {
|
||||
if x {
|
||||
*opacity = 1.;
|
||||
}
|
||||
input
|
||||
}
|
||||
Reference in New Issue
Block a user