@@ -6,7 +6,7 @@ use crate::messages::layout::utility_types::widget_prelude::*;
66use crate :: messages:: portfolio:: document:: document_message_handler:: navigation_controls;
77use crate :: messages:: portfolio:: document:: graph_operation:: utility_types:: ModifyInputsContext ;
88use crate :: messages:: portfolio:: document:: node_graph:: document_node_definitions:: NodePropertiesContext ;
9- use crate :: messages:: portfolio:: document:: node_graph:: utility_types:: { ContextMenuData , Direction , FrontendGraphDataType , NodeGraphError } ;
9+ use crate :: messages:: portfolio:: document:: node_graph:: utility_types:: { ContextMenuData , Direction , FrontendGraphDataType , NodeGraphErrorDiagnostic } ;
1010use crate :: messages:: portfolio:: document:: utility_types:: document_metadata:: LayerNodeIdentifier ;
1111use crate :: messages:: portfolio:: document:: utility_types:: misc:: GroupFolderType ;
1212use crate :: messages:: portfolio:: document:: utility_types:: network_interface:: {
@@ -798,9 +798,8 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
798798 DVec2 :: new ( appear_right_of_mouse, appear_above_mouse) / network_metadata. persistent_metadata . navigation_metadata . node_graph_to_viewport . matrix2 . x_axis . x
799799 } ;
800800
801- let context_menu_coordinates = node_graph_point + node_graph_shift;
802801 self . context_menu = Some ( ContextMenuInformation {
803- context_menu_coordinates : context_menu_coordinates . into ( ) ,
802+ context_menu_coordinates : ( node_graph_point + node_graph_shift ) . into ( ) ,
804803 context_menu_data,
805804 } ) ;
806805
@@ -1224,10 +1223,9 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
12241223 let node_graph_shift = DVec2 :: new ( appear_right_of_mouse, appear_above_mouse) / network_metadata. persistent_metadata . navigation_metadata . node_graph_to_viewport . matrix2 . x_axis . x ;
12251224
12261225 let compatible_type = network_interface. output_type ( & output_connector, selection_network_path) . add_node_string ( ) ;
1227- let context_menu_coordinates = point + node_graph_shift;
12281226
12291227 self . context_menu = Some ( ContextMenuInformation {
1230- context_menu_coordinates : context_menu_coordinates . into ( ) ,
1228+ context_menu_coordinates : ( point + node_graph_shift ) . into ( ) ,
12311229 context_menu_data : ContextMenuData :: CreateNode { compatible_type } ,
12321230 } ) ;
12331231
@@ -1652,7 +1650,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
16521650 responses. add ( NodeGraphMessage :: UpdateVisibleNodes ) ;
16531651
16541652 let error = self . node_graph_error ( network_interface, breadcrumb_network_path) ;
1655- responses. add ( FrontendMessage :: UpdateNodeGraphError { error } ) ;
1653+ responses. add ( FrontendMessage :: UpdateNodeGraphErrorDiagnostic { error } ) ;
16561654 let ( layer_widths, chain_widths, has_left_input_wire) = network_interface. collect_layer_widths ( breadcrumb_network_path) ;
16571655
16581656 responses. add ( NodeGraphMessage :: UpdateImportsExports ) ;
@@ -2596,26 +2594,27 @@ impl NodeGraphMessageHandler {
25962594 Some ( subgraph_names)
25972595 }
25982596
2599- fn node_graph_error ( & self , network_interface : & mut NodeNetworkInterface , breadcrumb_network_path : & [ NodeId ] ) -> Option < NodeGraphError > {
2597+ fn node_graph_error ( & self , network_interface : & mut NodeNetworkInterface , breadcrumb_network_path : & [ NodeId ] ) -> Option < NodeGraphErrorDiagnostic > {
26002598 let graph_error = network_interface
26012599 . resolved_types
26022600 . node_graph_errors
26032601 . iter ( )
2604- . filter ( |error| error. node_path . starts_with ( breadcrumb_network_path) && error. node_path . len ( ) > breadcrumb_network_path. len ( ) )
2605- . next ( ) ?;
2602+ . find ( |error| error. node_path . starts_with ( breadcrumb_network_path) && error. node_path . len ( ) > breadcrumb_network_path. len ( ) ) ?;
26062603 let error = if graph_error. node_path . len ( ) == breadcrumb_network_path. len ( ) + 1 {
26072604 format ! ( "{:?}" , graph_error. error)
26082605 } else {
26092606 "Node graph type error within this node" . to_string ( )
26102607 } ;
26112608 let error_node = graph_error. node_path [ breadcrumb_network_path. len ( ) ] ;
2609+
26122610 let mut position = network_interface. position ( & error_node, breadcrumb_network_path) ?;
26132611 // Convert to graph space
26142612 position *= 24 ;
26152613 if network_interface. is_layer ( & error_node, breadcrumb_network_path) {
26162614 position += IVec2 :: new ( 12 , -12 )
26172615 }
2618- Some ( NodeGraphError { position : position. into ( ) , error } )
2616+
2617+ Some ( NodeGraphErrorDiagnostic { position : position. into ( ) , error } )
26192618 }
26202619
26212620 fn update_layer_panel ( network_interface : & NodeNetworkInterface , selection_network_path : & [ NodeId ] , collapsed : & CollapsedLayers , layers_panel_open : bool , responses : & mut VecDeque < Message > ) {
0 commit comments