@@ -63,20 +63,21 @@ pub struct NodeGraphMessageHandler {
6363 pub drag_start_chain_nodes : Vec < NodeId > ,
6464 /// If dragging the background to create a box selection, this stores its starting point in node graph coordinates,
6565 /// plus a flag indicating if it has been dragged since the mousedown began.
66- box_selection_start : Option < ( DVec2 , bool ) > ,
66+ pub box_selection_start : Option < ( DVec2 , bool ) > ,
6767 /// Restore the selection before box selection if it is aborted
68- selection_before_pointer_down : Vec < NodeId > ,
68+ pub selection_before_pointer_down : Vec < NodeId > ,
6969 /// If the grip icon is held during a drag, then shift without pushing other nodes
7070 shift_without_push : bool ,
7171 disconnecting : Option < InputConnector > ,
7272 initial_disconnecting : bool ,
7373 /// Node to select on pointer up if multiple nodes are selected and they were not dragged.
7474 select_if_not_dragged : Option < NodeId > ,
75- /// The start of the dragged line (cannot be moved), stored in node graph coordinates
75+ /// The start of the dragged line (cannot be moved), stored in node graph coordinates.
7676 pub wire_in_progress_from_connector : Option < DVec2 > ,
77- wire_in_progress_type : FrontendGraphDataType ,
78- /// The end point of the dragged line (cannot be moved), stored in node graph coordinates
77+ /// The end point of the dragged line (cannot be moved), stored in node graph coordinates.
7978 pub wire_in_progress_to_connector : Option < DVec2 > ,
79+ /// The data type determining the color of the wire being dragged.
80+ pub wire_in_progress_type : FrontendGraphDataType ,
8081 /// State for the context menu popups.
8182 pub context_menu : Option < ContextMenuInformation > ,
8283 /// Index of selected node to be deselected on pointer up when shift clicking an already selected node
@@ -295,8 +296,8 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
295296 }
296297
297298 self . wire_in_progress_from_connector = None ;
298- self . wire_in_progress_type = FrontendGraphDataType :: General ;
299299 self . wire_in_progress_to_connector = None ;
300+ self . wire_in_progress_type = FrontendGraphDataType :: General ;
300301 }
301302 responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path : None } ) ;
302303 responses. add ( FrontendMessage :: UpdateContextMenuInformation {
@@ -768,8 +769,9 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
768769 // Abort dragging a wire
769770 if self . wire_in_progress_from_connector . is_some ( ) {
770771 self . wire_in_progress_from_connector = None ;
771- self . wire_in_progress_type = FrontendGraphDataType :: General ;
772772 self . wire_in_progress_to_connector = None ;
773+ self . wire_in_progress_type = FrontendGraphDataType :: General ;
774+
773775 responses. add ( DocumentMessage :: AbortTransaction ) ;
774776 responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path : None } ) ;
775777 return ;
@@ -850,8 +852,9 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
850852 if self . context_menu . is_some ( ) {
851853 self . context_menu = None ;
852854 self . wire_in_progress_from_connector = None ;
853- self . wire_in_progress_type = FrontendGraphDataType :: General ;
854855 self . wire_in_progress_to_connector = None ;
856+ self . wire_in_progress_type = FrontendGraphDataType :: General ;
857+
855858 responses. add ( FrontendMessage :: UpdateContextMenuInformation {
856859 context_menu_information : self . context_menu . clone ( ) ,
857860 } ) ;
@@ -1388,14 +1391,18 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
13881391 } ) ;
13891392 responses. add ( DocumentMessage :: EndTransaction ) ;
13901393 }
1394+
13911395 self . drag_start = None ;
13921396 self . begin_dragging = false ;
13931397 self . box_selection_start = None ;
1398+
13941399 self . wire_in_progress_from_connector = None ;
1395- self . wire_in_progress_type = FrontendGraphDataType :: General ;
13961400 self . wire_in_progress_to_connector = None ;
1401+ self . wire_in_progress_type = FrontendGraphDataType :: General ;
1402+
13971403 self . reordering_export = None ;
13981404 self . reordering_import = None ;
1405+
13991406 responses. add ( DocumentMessage :: EndTransaction ) ;
14001407 responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path : None } ) ;
14011408 responses. add ( FrontendMessage :: UpdateBox { box_selection : None } ) ;
0 commit comments