11use super :: node_properties;
2- use super :: utility_types:: { BoxSelection , ContextMenuInformation , DragStart , FrontendNode } ;
2+ use super :: utility_types:: { ContextMenuInformation , DragStart , FrontendNode , NodeGraphSelectionBox } ;
33use crate :: consts:: GRID_SIZE ;
44use crate :: messages:: clipboard:: utility_types:: ClipboardContent ;
55use crate :: messages:: input_mapper:: utility_types:: macros:: { action_shortcut, action_shortcut_manual} ;
@@ -9,14 +9,14 @@ use crate::messages::portfolio::document::graph_operation::utility_types::Modify
99use crate :: messages:: portfolio:: document:: node_graph:: document_node_definitions:: {
1010 DefinitionIdentifier , NodePropertiesContext , resolve_document_node_type, resolve_network_node_type, resolve_proto_node_type,
1111} ;
12- use crate :: messages:: portfolio:: document:: node_graph:: utility_types:: { ContextMenuData , Direction , FrontendGraphDataType , NodeGraphErrorDiagnostic } ;
12+ use crate :: messages:: portfolio:: document:: node_graph:: utility_types:: { ContextMenuData , Direction , FrontendGraphDataType , NodeGraphErrorDiagnostic , WirePathInProgress } ;
1313use crate :: messages:: portfolio:: document:: utility_types:: document_metadata:: LayerNodeIdentifier ;
1414use crate :: messages:: portfolio:: document:: utility_types:: misc:: GroupFolderType ;
1515use crate :: messages:: portfolio:: document:: utility_types:: network_interface:: {
1616 self , FlowType , InputConnector , NodeNetworkInterface , NodeTemplate , NodeTypePersistentMetadata , OutputConnector , Previewing ,
1717} ;
1818use crate :: messages:: portfolio:: document:: utility_types:: nodes:: { CollapsedLayers , LayerPanelEntry } ;
19- use crate :: messages:: portfolio:: document:: utility_types:: wires:: { GraphWireStyle , WirePath , WirePathUpdate , build_vector_wire} ;
19+ use crate :: messages:: portfolio:: document:: utility_types:: wires:: { GraphWireStyle , WirePathUpdate , build_vector_wire} ;
2020use crate :: messages:: prelude:: * ;
2121use crate :: messages:: tool:: common_functionality:: auto_panning:: AutoPanning ;
2222use crate :: messages:: tool:: common_functionality:: graph_modification_utils:: get_clip_mode;
@@ -329,7 +329,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
329329 self . wire_in_progress_to_connector = None ;
330330 self . wire_in_progress_type = FrontendGraphDataType :: General ;
331331 }
332- responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path : None } ) ;
332+ responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path_in_progress : None } ) ;
333333 responses. add ( FrontendMessage :: UpdateContextMenuInformation {
334334 context_menu_information : self . context_menu . clone ( ) ,
335335 } ) ;
@@ -790,7 +790,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
790790 responses. add ( NodeGraphMessage :: SelectedNodesSet {
791791 nodes : self . selection_before_pointer_down . clone ( ) ,
792792 } ) ;
793- responses. add ( FrontendMessage :: UpdateBox { box_selection : None } ) ;
793+ responses. add ( FrontendMessage :: UpdateNodeGraphSelectionBox { selection_box : None } ) ;
794794 return ;
795795 }
796796 // Abort dragging a wire
@@ -800,7 +800,8 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
800800 self . wire_in_progress_type = FrontendGraphDataType :: General ;
801801
802802 responses. add ( DocumentMessage :: AbortTransaction ) ;
803- responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path : None } ) ;
803+ responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path_in_progress : None } ) ;
804+
804805 return ;
805806 }
806807
@@ -885,7 +886,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
885886 responses. add ( FrontendMessage :: UpdateContextMenuInformation {
886887 context_menu_information : self . context_menu . clone ( ) ,
887888 } ) ;
888- responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path : None } ) ;
889+ responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path_in_progress : None } ) ;
889890 }
890891
891892 // Toggle visibility of clicked node and return
@@ -1094,14 +1095,14 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
10941095 to_connector_is_layer,
10951096 GraphWireStyle :: Direct ,
10961097 ) ;
1097- let path_string = vector_wire. to_svg ( ) ;
1098- let wire_path = WirePath {
1099- path_string,
1098+ let wire_path = WirePathInProgress {
1099+ wire : vector_wire. to_svg ( ) ,
11001100 data_type : self . wire_in_progress_type ,
11011101 thick : false ,
1102- dashed : false ,
11031102 } ;
1104- responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path : Some ( wire_path) } ) ;
1103+ responses. add ( FrontendMessage :: UpdateWirePathInProgress {
1104+ wire_path_in_progress : Some ( wire_path) ,
1105+ } ) ;
11051106 }
11061107 } else if let Some ( ( drag_start, dragged) ) = & mut self . drag_start {
11071108 if drag_start. start_x != point. x || drag_start. start_y != point. y {
@@ -1431,8 +1432,8 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
14311432 self . reordering_import = None ;
14321433
14331434 responses. add ( DocumentMessage :: EndTransaction ) ;
1434- responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path : None } ) ;
1435- responses. add ( FrontendMessage :: UpdateBox { box_selection : None } ) ;
1435+ responses. add ( FrontendMessage :: UpdateWirePathInProgress { wire_path_in_progress : None } ) ;
1436+ responses. add ( FrontendMessage :: UpdateNodeGraphSelectionBox { selection_box : None } ) ;
14361437 responses. add ( FrontendMessage :: UpdateImportReorderIndex { index : None } ) ;
14371438 responses. add ( FrontendMessage :: UpdateExportReorderIndex { index : None } ) ;
14381439 self . update_node_graph_hints ( responses) ;
@@ -1926,23 +1927,14 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
19261927 }
19271928 NodeGraphMessage :: UpdateBoxSelection => {
19281929 if let Some ( ( box_selection_start, _) ) = self . box_selection_start {
1929- // The mouse button was released but we missed the pointer up event
1930- // if ((e.buttons & 1) === 0) {
1931- // completeBoxSelection();
1932- // boxSelection = undefined;
1933- // } else if ((e.buttons & 2) !== 0) {
1934- // editor.handle.selectNodes(new BigUint64Array(previousSelection));
1935- // boxSelection = undefined;
1936- // }
1937-
19381930 let Some ( network_metadata) = network_interface. network_metadata ( selection_network_path) else {
19391931 log:: error!( "Could not get network metadata in UpdateBoxSelection" ) ;
19401932 return ;
19411933 } ;
19421934
19431935 let box_selection_start_viewport = network_metadata. persistent_metadata . navigation_metadata . node_graph_to_viewport . transform_point2 ( box_selection_start) ;
19441936
1945- let box_selection = Some ( BoxSelection {
1937+ let selection_box = Some ( NodeGraphSelectionBox {
19461938 start_x : box_selection_start_viewport. x . max ( 0. ) as u32 ,
19471939 start_y : box_selection_start_viewport. y . max ( 0. ) as u32 ,
19481940 end_x : ipp. mouse . position . x . max ( 0. ) as u32 ,
@@ -1987,7 +1979,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
19871979 nodes : nodes. into_iter ( ) . collect :: < Vec < _ > > ( ) ,
19881980 } ) ;
19891981 }
1990- responses. add ( FrontendMessage :: UpdateBox { box_selection } )
1982+ responses. add ( FrontendMessage :: UpdateNodeGraphSelectionBox { selection_box } )
19911983 }
19921984 }
19931985 NodeGraphMessage :: UpdateImportsExports => {
0 commit comments