mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-04 10:18:11 +08:00
Fix crash when creating cyclic nodes (#3313)
* Fix crash when creating cyclic nodes * Re-add the recursive set_input call
This commit is contained in:
@@ -4262,11 +4262,6 @@ impl NodeNetworkInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let previous_metadata = match &previous_input {
|
|
||||||
NodeInput::Node { node_id, .. } => self.position(node_id, network_path).map(|position| (*node_id, position)),
|
|
||||||
_ => None,
|
|
||||||
};
|
|
||||||
|
|
||||||
let Some(network) = self.network_mut(network_path) else {
|
let Some(network) = self.network_mut(network_path) else {
|
||||||
log::error!("Could not get nested network in set_input");
|
log::error!("Could not get nested network in set_input");
|
||||||
return;
|
return;
|
||||||
@@ -4303,6 +4298,12 @@ impl NodeNetworkInterface {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// It is necessary to ensure the grpah is acyclic before calling `self.position` as it sometimes crashes with cyclic graphs #3227
|
||||||
|
let previous_metadata = match &previous_input {
|
||||||
|
NodeInput::Node { node_id, .. } => self.position(node_id, network_path).map(|position| (*node_id, position)),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
|
|
||||||
self.transaction_modified();
|
self.transaction_modified();
|
||||||
|
|
||||||
// Ensure layer is toggled to non layer if it is no longer eligible to be a layer
|
// Ensure layer is toggled to non layer if it is no longer eligible to be a layer
|
||||||
|
|||||||
Reference in New Issue
Block a user