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:
parent
e242ce26a0
commit
c777d4d430
|
|
@ -278,6 +278,7 @@ impl NodeGraphMessageHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: clean up this massive function
|
||||||
fn send_graph(
|
fn send_graph(
|
||||||
&self,
|
&self,
|
||||||
network: &NodeNetwork,
|
network: &NodeNetwork,
|
||||||
|
|
@ -386,14 +387,6 @@ impl NodeGraphMessageHandler {
|
||||||
} else {
|
} else {
|
||||||
LayerClassification::Layer
|
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 {
|
let data = LayerPanelEntry {
|
||||||
|
|
@ -402,11 +395,8 @@ impl NodeGraphMessageHandler {
|
||||||
expanded: layer.has_children(metadata) && !collapsed.0.contains(&layer),
|
expanded: layer.has_children(metadata) && !collapsed.0.contains(&layer),
|
||||||
depth: layer.ancestors(metadata).count() - 1,
|
depth: layer.ancestors(metadata).count() - 1,
|
||||||
parent_id: layer.parent(metadata).map(|parent| parent.to_node()),
|
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(),
|
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() },
|
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),
|
disabled: network.disabled.contains(&node_id),
|
||||||
};
|
};
|
||||||
responses.add(FrontendMessage::UpdateDocumentLayerDetails { data });
|
responses.add(FrontendMessage::UpdateDocumentLayerDetails { data });
|
||||||
|
|
|
||||||
|
|
@ -921,7 +921,7 @@
|
||||||
data-datatype={parameter.dataType}
|
data-datatype={parameter.dataType}
|
||||||
style:--data-color={`var(--color-data-${parameter.dataType})`}
|
style:--data-color={`var(--color-data-${parameter.dataType})`}
|
||||||
style:--data-color-dim={`var(--color-data-${parameter.dataType}-dim)`}
|
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>
|
<title>{`${dataTypeTooltip(parameter)}\nConnected to ${parameter.connected || "nothing"}`}</title>
|
||||||
{#if parameter.connected}
|
{#if parameter.connected}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue