Skip to content

Commit 2db2350

Browse files
committed
Fix missing defaults on node gradient inputs
1 parent 2ff647a commit 2db2350

File tree

1 file changed

+3
-0
lines changed
  • node-graph/graph-craft/src/document

1 file changed

+3
-0
lines changed

node-graph/graph-craft/src/document/value.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ macro_rules! tagged_value {
127127
// Tries using the default for the tagged value type. If it not implemented, then uses the default used in document_node_types. If it is not used there, then TaggedValue::None is returned.
128128
Some(match concrete_type.id? {
129129
x if x == TypeId::of::<()>() => TaggedValue::None,
130+
// Table-wrapped types need a single-row default with the element's default, not an empty table
131+
x if x == TypeId::of::<Table<Color>>() => TaggedValue::Color(Table::new_from_element(Color::default())),
132+
x if x == TypeId::of::<Table<GradientStops>>() => TaggedValue::GradientTable(Table::new_from_element(GradientStops::default())),
130133
$( x if x == TypeId::of::<$ty>() => TaggedValue::$identifier(Default::default()), )*
131134
_ => return None,
132135
})

0 commit comments

Comments
 (0)