mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 08:18:12 +08:00
Adapt the cutover to the reviewed core-types API
This commit is contained in:
@@ -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