@@ -92,10 +92,6 @@ pub struct NodeGraphMessageHandler {
92
92
reordering_export : Option < usize > ,
93
93
/// The end index of the moved connector
94
94
end_index : Option < usize > ,
95
- /// Used to keep track of what nodes are sent to the front end so that only visible ones are sent to the frontend
96
- frontend_nodes : Vec < NodeId > ,
97
- /// Disables rendering nodes in Svelte
98
- should_render_svelte_nodes : bool ,
99
95
}
100
96
101
97
/// NodeGraphMessageHandler always modifies the network which the selected nodes are in. No GraphOperationMessages should be added here, since those messages will always affect the document network.
@@ -1592,61 +1588,16 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
1592
1588
click_targets : Some ( network_interface. collect_frontend_click_targets ( breadcrumb_network_path) ) ,
1593
1589
} ) ,
1594
1590
NodeGraphMessage :: EndSendClickTargets => responses. add ( FrontendMessage :: UpdateClickTargets { click_targets : None } ) ,
1595
- NodeGraphMessage :: UpdateVisibleNodes => {
1596
- let Some ( network_metadata) = network_interface. network_metadata ( breadcrumb_network_path) else {
1597
- return ;
1598
- } ;
1599
-
1600
- let viewport_bbox = ipp. document_bounds ( ) ;
1601
- let document_bbox: [ DVec2 ; 2 ] = viewport_bbox. map ( |p| network_metadata. persistent_metadata . navigation_metadata . node_graph_to_viewport . inverse ( ) . transform_point2 ( p) ) ;
1602
-
1603
- let mut nodes = Vec :: new ( ) ;
1604
- for node_id in & self . frontend_nodes {
1605
- let Some ( node_bbox) = network_interface. node_bounding_box ( node_id, breadcrumb_network_path) else {
1606
- log:: error!( "Could not get bbox for node: {node_id:?}" ) ;
1607
- continue ;
1608
- } ;
1609
-
1610
- if node_bbox[ 1 ] . x >= document_bbox[ 0 ] . x && node_bbox[ 0 ] . x <= document_bbox[ 1 ] . x && node_bbox[ 1 ] . y >= document_bbox[ 0 ] . y && node_bbox[ 0 ] . y <= document_bbox[ 1 ] . y {
1611
- nodes. push ( * node_id) ;
1612
- }
1613
- for error in & self . node_graph_errors {
1614
- if error. node_path . contains ( node_id) {
1615
- nodes. push ( * node_id) ;
1616
- }
1617
- }
1618
- }
1619
-
1620
- responses. add ( FrontendMessage :: UpdateVisibleNodes { nodes } ) ;
1621
- }
1622
1591
NodeGraphMessage :: SendGraph => {
1623
1592
responses. add ( NodeGraphMessage :: UpdateLayerPanel ) ;
1624
1593
responses. add ( DocumentMessage :: DocumentStructureChanged ) ;
1625
1594
responses. add ( PropertiesPanelMessage :: Refresh ) ;
1626
1595
responses. add ( NodeGraphMessage :: UpdateActionButtons ) ;
1627
1596
1628
- if !self . should_render_svelte_nodes {
1629
- // Generate and render node graph overlay network
1630
- } else {
1631
- let nodes_to_render = network_interface. collect_nodes ( & self . node_graph_errors , preferences. graph_wire_style , breadcrumb_network_path) ;
1632
- self . frontend_nodes = nodes_to_render. iter ( ) . map ( |node| node. metadata . node_id ) . collect ( ) ;
1633
- let previewed_node = network_interface. previewed_node ( breadcrumb_network_path) ;
1634
- }
1635
- responses. add ( NodeGraphMessage :: UpdateVisibleNodes ) ;
1636
-
1637
- let layer_widths = network_interface. collect_layer_widths ( breadcrumb_network_path) ;
1638
-
1597
+ responses. add ( FrontendMessage :: RequestNativeNodeGraphRender ) ;
1639
1598
responses. add ( NodeGraphMessage :: UpdateImportsExports ) ;
1640
- responses. add ( FrontendMessage :: UpdateLayerWidths { layer_widths } ) ;
1641
1599
self . update_node_graph_hints ( responses) ;
1642
1600
}
1643
- NodeGraphMessage :: SetGridAlignedEdges => {
1644
- if graph_view_overlay_open {
1645
- network_interface. set_grid_aligned_edges ( DVec2 :: new ( ipp. viewport_bounds . bottom_right . x - ipp. viewport_bounds . top_left . x , 0. ) , breadcrumb_network_path) ;
1646
- // Send the new edges to the frontend
1647
- responses. add ( NodeGraphMessage :: UpdateImportsExports ) ;
1648
- }
1649
- }
1650
1601
NodeGraphMessage :: SetInputValue { node_id, input_index, value } => {
1651
1602
let input = NodeInput :: value ( value, false ) ;
1652
1603
responses. add ( NodeGraphMessage :: SetInput {
@@ -1782,14 +1733,6 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
1782
1733
NodeGraphMessage :: TogglePreviewImpl { node_id } => {
1783
1734
network_interface. toggle_preview ( node_id, selection_network_path) ;
1784
1735
}
1785
- NodeGraphMessage :: ToggleNativeNodeGraphRender => {
1786
- self . should_render_svelte_nodes = !self . should_render_svelte_nodes ;
1787
- responses. add ( FrontendMessage :: UpdateShouldRenderSvelteNodes {
1788
- should_render_svelte_nodes : self . should_render_svelte_nodes ,
1789
- } ) ;
1790
- responses. add ( NodeGraphMessage :: SendGraph ) ;
1791
- responses. add ( MenuBarMessage :: SendLayout ) ;
1792
- }
1793
1736
NodeGraphMessage :: ToggleSelectedLocked => {
1794
1737
let Some ( selected_nodes) = network_interface. selected_nodes_in_nested_network ( selection_network_path) else {
1795
1738
log:: error!( "Could not get selected nodes in NodeGraphMessage::ToggleSelectedLocked" ) ;
@@ -1959,7 +1902,6 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
1959
1902
// Do not show the add import or add export button in the document network;
1960
1903
let add_import_export = !breadcrumb_network_path. is_empty ( ) ;
1961
1904
1962
- responses. add ( NodeGraphMessage :: UpdateVisibleNodes ) ;
1963
1905
responses. add ( FrontendMessage :: UpdateImportsExports {
1964
1906
imports,
1965
1907
exports,
@@ -1972,9 +1914,6 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
1972
1914
NodeGraphMessage :: UpdateLayerPanel => {
1973
1915
Self :: update_layer_panel ( network_interface, selection_network_path, collapsed, layers_panel_open, responses) ;
1974
1916
}
1975
- NodeGraphMessage :: UpdateEdges => {
1976
- // Update the import/export UI edges whenever the PTZ changes or the bounding box of all nodes changes
1977
- }
1978
1917
NodeGraphMessage :: UpdateNewNodeGraph => {
1979
1918
let Some ( selected_nodes) = network_interface. selected_nodes_mut ( selection_network_path) else {
1980
1919
log:: error!( "Could not get selected nodes in NodeGraphMessage::UpdateNewNodeGraph" ) ;
@@ -2620,8 +2559,6 @@ impl Default for NodeGraphMessageHandler {
2620
2559
reordering_export : None ,
2621
2560
reordering_import : None ,
2622
2561
end_index : None ,
2623
- frontend_nodes : Vec :: new ( ) ,
2624
- should_render_svelte_nodes : false ,
2625
2562
}
2626
2563
}
2627
2564
}
0 commit comments