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 a6876cbe4d..f79f17d60b 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 @@ -79,6 +79,8 @@ pub struct NodeGraphMessageHandler { pub wire_in_progress_from_connector: Option, /// The end point of the dragged line (cannot be moved), stored in node graph coordinates. pub wire_in_progress_to_connector: Option, + /// If the end point should be displayed as a vertical or horizontal connection + pub to_connector_is_layer: bool, /// The data type determining the color of the wire being dragged. pub wire_in_progress_type: FrontendGraphDataType, /// State for the context menu popups. @@ -1037,6 +1039,11 @@ impl<'a> MessageHandler> for NodeG return; }; self.wire_in_progress_to_connector = Some(input_position); + self.to_connector_is_layer = if let InputConnector::Node { node_id, input_index } = to_connector { + *input_index == 0 && network_interface.is_layer(node_id, selection_network_path) + } else { + false + }; } // Not hovering over a node input or node output, update with the mouse position. else { @@ -1081,24 +1088,17 @@ impl<'a> MessageHandler> for NodeG false } }); - let to_connector_is_layer = to_connector.is_some_and(|to_connector| { - if let InputConnector::Node { node_id, input_index } = to_connector { - input_index == 0 && network_interface.is_layer(&node_id, selection_network_path) - } else { - false - } - }); let vector_wire = build_vector_wire( wire_in_progress_from_connector, wire_in_progress_to_connector, from_connector_is_layer, - to_connector_is_layer, + self.to_connector_is_layer, GraphWireStyle::Direct, ); let wire_path = WirePathInProgress { wire: vector_wire.to_svg(), data_type: self.wire_in_progress_type, - thick: false, + thick: self.to_connector_is_layer && from_connector_is_layer, }; responses.add(FrontendMessage::UpdateWirePathInProgress { wire_path_in_progress: Some(wire_path), @@ -2799,6 +2799,7 @@ impl Default for NodeGraphMessageHandler { select_if_not_dragged: None, wire_in_progress_from_connector: None, wire_in_progress_to_connector: None, + to_connector_is_layer: false, wire_in_progress_type: FrontendGraphDataType::General, context_menu: None, deselect_on_pointer_up: None,