Skip to content

Commit 65d621e

Browse files
committed
Fix input type identification
1 parent 0f99f27 commit 65d621e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,14 +2146,17 @@ impl NodeGraphMessageHandler {
21462146
.icon(Some("Node".to_string()))
21472147
.tooltip("Add an operation to the end of this layer's chain of nodes")
21482148
.popover_layout({
2149-
let input_connector = InputConnector::node(layer, 1);
2150-
let compatible_type =
2151-
if let Some(OutputConnector::Node { node_id, .. }) = context.network_interface.upstream_output_connector(&input_connector, &context.selection_network_path) {
2152-
let (output_type, _) = context.network_interface.output_type(&node_id, 0, &context.selection_network_path);
2149+
let layer_identifier = LayerNodeIdentifier::new(layer, &context.network_interface, context.selection_network_path);
2150+
let compatible_type = {
2151+
let graph_layer = graph_modification_utils::NodeGraphLayer::new(layer_identifier, &context.network_interface);
2152+
let node_type = graph_layer.horizontal_layer_flow().nth(1);
2153+
if let Some(node_id) = node_type {
2154+
let (output_type, _) = context.network_interface.output_type(&node_id, 0, &[]);
21532155
Some(format!("type:{}", output_type.nested_type()))
21542156
} else {
21552157
None
2156-
};
2158+
}
2159+
};
21572160

21582161
let mut node_chooser = NodeCatalog::new();
21592162
node_chooser.intial_search = compatible_type.unwrap_or("".to_string());

0 commit comments

Comments
 (0)