From c777d4d4305646bb6de60539d65092bb9e759d32 Mon Sep 17 00:00:00 2001 From: 0HyperCube <78500760+0HyperCube@users.noreply.github.com> Date: Sun, 14 Jan 2024 00:35:45 +0000 Subject: [PATCH] Work around the weird treatment of the primary input (#1575) * Work around the weird treatment of the primary input * take2 --- .../node_graph/node_graph_message_handler.rs | 12 +----------- frontend/src/components/views/Graph.svelte | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs index 56af63ff..65450a10 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs @@ -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 }); diff --git a/frontend/src/components/views/Graph.svelte b/frontend/src/components/views/Graph.svelte index d0336bf0..2d33bf48 100644 --- a/frontend/src/components/views/Graph.svelte +++ b/frontend/src/components/views/Graph.svelte @@ -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)]} > {`${dataTypeTooltip(parameter)}\nConnected to ${parameter.connected || "nothing"}`} {#if parameter.connected}