mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
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
1 changed files with 6 additions and 1 deletions
|
|
@ -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 {
|
||||
new_ids
|
||||
.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())))
|
||||
.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.update_selected(document, responses);
|
||||
responses.add(NodeGraphMessage::SendGraph { should_rerender: false });
|
||||
}
|
||||
}
|
||||
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
|
||||
let mut shift = IVec2::ZERO;
|
||||
while data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue