mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 04:38:11 +08:00
Fix some node connection UI issues (#1248)
This commit is contained in:
committed by
Keavon Chambers
parent
15eb4df8d4
commit
0c7b55949d
@@ -540,7 +540,13 @@ impl MessageHandler<NodeGraphMessage, (&mut Document, &NodeGraphExecutor, u64)>
|
|||||||
|
|
||||||
responses.add(DocumentMessage::StartTransaction);
|
responses.add(DocumentMessage::StartTransaction);
|
||||||
|
|
||||||
let input = node_type.inputs[input_index].default.clone();
|
let Some((input_index, existing_input)) = node.inputs.iter().enumerate().filter(|(_, input)| input.is_exposed()).nth(input_index) else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
let mut input = node_type.inputs[input_index].default.clone();
|
||||||
|
if let NodeInput::Value { exposed, .. } = &mut input {
|
||||||
|
*exposed = existing_input.is_exposed();
|
||||||
|
}
|
||||||
responses.add(NodeGraphMessage::SetNodeInput { node_id, input_index, input });
|
responses.add(NodeGraphMessage::SetNodeInput { node_id, input_index, input });
|
||||||
|
|
||||||
let should_rerender = network.connected_to_output(node_id, true);
|
let should_rerender = network.connected_to_output(node_id, true);
|
||||||
|
|||||||
@@ -287,7 +287,7 @@
|
|||||||
const links = $nodeGraph.links;
|
const links = $nodeGraph.links;
|
||||||
const linkIndex = links.findIndex((value) => value.linkEnd === nodeIdInt && value.linkEndInputIndex === inputIndexInt);
|
const linkIndex = links.findIndex((value) => value.linkEnd === nodeIdInt && value.linkEndInputIndex === inputIndexInt);
|
||||||
const nodeOutputConnectors = nodesContainer?.querySelectorAll(`[data-node="${String(links[linkIndex].linkStart)}"] [data-port="output"]`) || undefined;
|
const nodeOutputConnectors = nodesContainer?.querySelectorAll(`[data-node="${String(links[linkIndex].linkStart)}"] [data-port="output"]`) || undefined;
|
||||||
linkInProgressFromConnector = nodeOutputConnectors?.[Number(links[linkIndex].linkEndInputIndex)] as HTMLDivElement | undefined;
|
linkInProgressFromConnector = nodeOutputConnectors?.[Number(links[linkIndex].linkStartOutputIndex)] as HTMLDivElement | undefined;
|
||||||
const nodeInputConnectors = nodesContainer?.querySelectorAll(`[data-node="${String(links[linkIndex].linkEnd)}"] [data-port="input"]`) || undefined;
|
const nodeInputConnectors = nodesContainer?.querySelectorAll(`[data-node="${String(links[linkIndex].linkEnd)}"] [data-port="input"]`) || undefined;
|
||||||
linkInProgressToConnector = nodeInputConnectors?.[Number(links[linkIndex].linkEndInputIndex)] as HTMLDivElement | undefined;
|
linkInProgressToConnector = nodeInputConnectors?.[Number(links[linkIndex].linkEndInputIndex)] as HTMLDivElement | undefined;
|
||||||
disconnecting = { nodeId: nodeIdInt, inputIndex, linkIndex };
|
disconnecting = { nodeId: nodeIdInt, inputIndex, linkIndex };
|
||||||
|
|||||||
Reference in New Issue
Block a user