mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
Don't include the document node path in the stable node id by default (#1388)
* Don't include the document node path in the stable node id by default Make the inclusion of the document path for the stable node id optional and only enable it for the MonitorNode for now * Fix tests
This commit is contained in:
@@ -40,6 +40,8 @@ pub struct DocumentNode {
|
||||
pub inputs: Vec<NodeInput>,
|
||||
pub implementation: DocumentNodeImplementation,
|
||||
pub metadata: DocumentNodeMetadata,
|
||||
#[serde(default)]
|
||||
pub skip_deduplication: bool,
|
||||
pub path: Option<Vec<NodeId>>,
|
||||
}
|
||||
|
||||
@@ -97,6 +99,7 @@ impl DocumentNode {
|
||||
input,
|
||||
construction_args: args,
|
||||
document_node_path: self.path.unwrap_or(Vec::new()),
|
||||
skip_deduplication: self.skip_deduplication,
|
||||
}
|
||||
} else {
|
||||
unreachable!("tried to resolve not flattened node on resolved node {:?}", self);
|
||||
@@ -1063,6 +1066,7 @@ mod test {
|
||||
input: ProtoNodeInput::Network(concrete!(u32)),
|
||||
construction_args: ConstructionArgs::Nodes(vec![(0, false)]),
|
||||
document_node_path: vec![],
|
||||
skip_deduplication: false,
|
||||
};
|
||||
assert_eq!(proto_node, reference);
|
||||
}
|
||||
@@ -1080,6 +1084,7 @@ mod test {
|
||||
input: ProtoNodeInput::Network(concrete!(u32)),
|
||||
construction_args: ConstructionArgs::Nodes(vec![(14, false)]),
|
||||
document_node_path: vec![1, 0],
|
||||
skip_deduplication: false,
|
||||
},
|
||||
),
|
||||
(
|
||||
@@ -1089,6 +1094,7 @@ mod test {
|
||||
input: ProtoNodeInput::Node(10, false),
|
||||
construction_args: ConstructionArgs::Nodes(vec![]),
|
||||
document_node_path: vec![1, 1],
|
||||
skip_deduplication: false,
|
||||
},
|
||||
),
|
||||
(14, ProtoNode::value(ConstructionArgs::Value(TaggedValue::U32(2)), vec![1, 4])),
|
||||
|
||||
Reference in New Issue
Block a user