Work around the weird treatment of the primary input (#1575)

* Work around the weird treatment of the primary input

* take2
This commit is contained in:
0HyperCube 2024-01-14 00:35:45 +00:00 committed by GitHub
parent e242ce26a0
commit c777d4d430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 12 deletions

View File

@ -278,6 +278,7 @@ impl NodeGraphMessageHandler {
}
}
// TODO: clean up this massive function
fn send_graph(
&self,
network: &NodeNetwork,
@ -386,14 +387,6 @@ impl NodeGraphMessageHandler {
} else {
LayerClassification::Layer
}
// TODO: Maybe switch to this below if perhaps it's simpler?
// if node.is_artboard() {
// LayerClassification::Artboard
// } else if node.is_folder(network) {
// LayerClassification::Folder
// } else {
// LayerClassification::Layer
// }
};
let data = LayerPanelEntry {
@ -402,11 +395,8 @@ impl NodeGraphMessageHandler {
expanded: layer.has_children(metadata) && !collapsed.0.contains(&layer),
depth: layer.ancestors(metadata).count() - 1,
parent_id: layer.parent(metadata).map(|parent| parent.to_node()),
// TODO: Remove and take this from the graph data in the frontend similar to thumbnail?
name: network.nodes.get(&node_id).map(|node| node.alias.clone()).unwrap_or_default(),
// TODO: Remove and take this from the graph data in the frontend similar to thumbnail?
tooltip: if cfg!(debug_assertions) { format!("Layer ID: {node_id}") } else { "".into() },
// TODO: Remove and take this from the graph data in the frontend similar to thumbnail?
disabled: network.disabled.contains(&node_id),
};
responses.add(FrontendMessage::UpdateDocumentLayerDetails { data });

View File

@ -921,7 +921,7 @@
data-datatype={parameter.dataType}
style:--data-color={`var(--color-data-${parameter.dataType})`}
style:--data-color-dim={`var(--color-data-${parameter.dataType}-dim)`}
bind:this={inputs[nodeIndex][index + 1]}
bind:this={inputs[nodeIndex][index + (node.primaryInput ? 1 : 0)]}
>
<title>{`${dataTypeTooltip(parameter)}\nConnected to ${parameter.connected || "nothing"}`}</title>
{#if parameter.connected}