Skip to content

Commit bf486b4

Browse files
Fix bug where nodes (like Text) with a non-visible primary input would gain a primary input when shaken (#3899)
* fix: Shaking a Text layer breaks its type signature * Add a second fix for the same issue --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
1 parent b7a1b3e commit bf486b4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,10 +1521,9 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
15211521
for input_index in 0..network_interface.number_of_inputs(selected_node, selection_network_path) {
15221522
let input_connector = InputConnector::node(*selected_node, input_index);
15231523
// Only disconnect inputs to non selected nodes
1524-
if !network_interface
1524+
if network_interface
15251525
.upstream_output_connector(&input_connector, selection_network_path)
1526-
.and_then(|connector| connector.node_id())
1527-
.is_some_and(|node_id| all_selected_nodes.contains(&node_id))
1526+
.is_some_and(|connector| connector.node_id().map_or(true, |node_id| !all_selected_nodes.contains(&node_id)))
15281527
{
15291528
responses.add(NodeGraphMessage::DisconnectInput { input_connector });
15301529
}

editor/src/messages/portfolio/document/utility_types/network_interface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4068,8 +4068,8 @@ impl NodeNetworkInterface {
40684068
log::error!("Could not get current input in disconnect_input");
40694069
return;
40704070
};
4071-
// Do not disconnect an already disconnected input
4072-
if matches!(current_input, NodeInput::Value { .. }) {
4071+
// Only disconnect inputs that are actual wire connections (Node or Import)
4072+
if !matches!(current_input, NodeInput::Node { .. } | NodeInput::Import { .. }) {
40734073
return;
40744074
}
40754075

0 commit comments

Comments
 (0)