mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-30 09:47:22 +00:00
Always update source node in borrow tree (#1758)
This commit is contained in:
parent
5a1c171fc3
commit
c80de41d28
1 changed files with 8 additions and 2 deletions
|
@ -134,6 +134,8 @@ impl BorrowTree {
|
|||
for (id, node) in proto_network.nodes {
|
||||
if !self.nodes.contains_key(&id) {
|
||||
self.push_node(id, node, typing_context).await?;
|
||||
} else {
|
||||
self.update_source_map(id, &node);
|
||||
}
|
||||
old_nodes.remove(&id);
|
||||
}
|
||||
|
@ -181,8 +183,7 @@ impl BorrowTree {
|
|||
self.nodes.remove(&id);
|
||||
}
|
||||
|
||||
/// Insert a new node into the borrow tree, calling the constructor function from `node_registry.rs`.
|
||||
pub async fn push_node(&mut self, id: NodeId, proto_node: ProtoNode, typing_context: &TypingContext) -> Result<(), GraphErrors> {
|
||||
pub fn update_source_map(&mut self, id: NodeId, proto_node: &ProtoNode) {
|
||||
self.source_map.insert(proto_node.original_location.path.clone().unwrap_or_default(), id);
|
||||
|
||||
let params = match &proto_node.construction_args {
|
||||
|
@ -195,6 +196,11 @@ impl BorrowTree {
|
|||
for x in proto_node.original_location.outputs_source.values() {
|
||||
assert_eq!(*x, 0, "Proto nodes should refer to output index 0");
|
||||
}
|
||||
}
|
||||
|
||||
/// Insert a new node into the borrow tree, calling the constructor function from `node_registry.rs`.
|
||||
pub async fn push_node(&mut self, id: NodeId, proto_node: ProtoNode, typing_context: &TypingContext) -> Result<(), GraphErrors> {
|
||||
self.update_source_map(id, &proto_node);
|
||||
|
||||
match &proto_node.construction_args {
|
||||
ConstructionArgs::Value(value) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue