Skip to content

Commit 437fc70

Browse files
authored
Desktop: Fix Node Graph Overlay (#3042)
Replace usize::MAX with u32::MAX as a marker value which can be used on both native and wasm
1 parent fa2167d commit 437fc70

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ impl NodeGraphMessageHandler {
24162416
} else {
24172417
added_wires.push(WirePathUpdate {
24182418
id: NodeId(u64::MAX),
2419-
input_index: usize::MAX,
2419+
input_index: u32::MAX as usize,
24202420
wire_path_update: None,
24212421
})
24222422
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,7 +2635,7 @@ impl NodeNetworkInterface {
26352635
InputConnector::Node { node_id, input_index } => (*node_id, *input_index),
26362636
InputConnector::Export(export_index) => (NodeId(u64::MAX), *export_index),
26372637
})
2638-
.chain(std::iter::once((NodeId(u64::MAX), usize::MAX)))
2638+
.chain(std::iter::once((NodeId(u64::MAX), u32::MAX as usize)))
26392639
.collect()
26402640
}
26412641

@@ -2725,7 +2725,7 @@ impl NodeNetworkInterface {
27252725

27262726
Some(WirePathUpdate {
27272727
id: NodeId(u64::MAX),
2728-
input_index: usize::MAX,
2728+
input_index: u32::MAX as usize,
27292729
wire_path_update,
27302730
})
27312731
}
@@ -6047,7 +6047,7 @@ impl Iterator for FlowIter<'_> {
60476047
} else {
60486048
0
60496049
};
6050-
let take = if self.flow_type == FlowType::UpstreamFlow { usize::MAX } else { 1 };
6050+
let take = if self.flow_type == FlowType::UpstreamFlow { u32::MAX as usize } else { 1 };
60516051
let inputs = document_node.inputs.iter().skip(skip).take(take);
60526052

60536053
let node_ids = inputs.filter_map(|input| match input {

0 commit comments

Comments
 (0)