Fix node copy paste issues (#1208)
* Fix copy issue * Allow copying of input frame nodes * Fix duplication delay of node graphs --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
bb1e7c44cf
commit
1039f76502
|
|
@ -407,7 +407,7 @@ impl NodeGraphMessageHandler {
|
||||||
fn copy_nodes<'a>(network: &'a NodeNetwork, new_ids: &'a HashMap<NodeId, NodeId>) -> impl Iterator<Item = (NodeId, DocumentNode)> + 'a {
|
fn copy_nodes<'a>(network: &'a NodeNetwork, new_ids: &'a HashMap<NodeId, NodeId>) -> impl Iterator<Item = (NodeId, DocumentNode)> + 'a {
|
||||||
new_ids
|
new_ids
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|&(&id, _)| !network.outputs_contain(id) && !network.inputs.contains(&id))
|
.filter(|&(&id, _)| !network.outputs_contain(id))
|
||||||
.filter_map(|(&id, &new)| network.nodes.get(&id).map(|node| (new, node.clone())))
|
.filter_map(|(&id, &new)| network.nodes.get(&id).map(|node| (new, node.clone())))
|
||||||
.map(move |(new, node)| (new, node.map_ids(Self::default_node_input, new_ids)))
|
.map(move |(new, node)| (new, node.map_ids(Self::default_node_input, new_ids)))
|
||||||
}
|
}
|
||||||
|
|
@ -580,6 +580,7 @@ impl MessageHandler<NodeGraphMessage, (&mut Document, &NodeGraphExecutor)> for N
|
||||||
|
|
||||||
Self::send_graph(network, executor, &self.layer_path, responses);
|
Self::send_graph(network, executor, &self.layer_path, responses);
|
||||||
self.update_selected(document, responses);
|
self.update_selected(document, responses);
|
||||||
|
responses.add(NodeGraphMessage::SendGraph { should_rerender: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NodeGraphMessage::ExitNestedNetwork { depth_of_nesting } => {
|
NodeGraphMessage::ExitNestedNetwork { depth_of_nesting } => {
|
||||||
|
|
@ -669,6 +670,10 @@ impl MessageHandler<NodeGraphMessage, (&mut Document, &NodeGraphExecutor)> for N
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if data.is_empty() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Shift nodes until it is not in the same position as another node
|
// Shift nodes until it is not in the same position as another node
|
||||||
let mut shift = IVec2::ZERO;
|
let mut shift = IVec2::ZERO;
|
||||||
while data
|
while data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue