mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 10:38:12 +08:00
Improve previewing node data (#1446)
* Improve preview * Improve contrast * Restructure in order to duplicate code * Code review nits --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
c823016316
commit
e0ac073805
@@ -111,23 +111,24 @@ impl<T> LetNode<T> {
|
||||
|
||||
/// Caches the output of a given Node and acts as a proxy
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default)]
|
||||
pub struct EndLetNode<Input> {
|
||||
pub struct EndLetNode<Input, Parameter> {
|
||||
input: Input,
|
||||
paramenter: PhantomData<Parameter>,
|
||||
}
|
||||
impl<'i, T: 'i, Input> Node<'i, T> for EndLetNode<Input>
|
||||
impl<'i, T: 'i, Parameter: 'i + From<T>, Input> Node<'i, T> for EndLetNode<Input, Parameter>
|
||||
where
|
||||
Input: Node<'i, ()>,
|
||||
Input: Node<'i, Parameter>,
|
||||
{
|
||||
type Output = <Input>::Output;
|
||||
fn eval(&'i self, _: T) -> Self::Output {
|
||||
let result = self.input.eval(());
|
||||
fn eval(&'i self, t: T) -> Self::Output {
|
||||
let result = self.input.eval(Parameter::from(t));
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
impl<Input> EndLetNode<Input> {
|
||||
pub const fn new(input: Input) -> EndLetNode<Input> {
|
||||
EndLetNode { input }
|
||||
impl<Input, Parameter> EndLetNode<Input, Parameter> {
|
||||
pub const fn new(input: Input) -> EndLetNode<Input, Parameter> {
|
||||
EndLetNode { input, paramenter: PhantomData }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user