@@ -313,7 +313,7 @@ func get_padded_node_rect(graph_node:GraphNode) -> Rect2:
313313func _draw () -> void :
314314 if drag_cut_line .size () > 1 :
315315 draw_polyline (drag_cut_line , get_theme_color ("connection_knife" , "GraphEdit" ), 1.0 )
316- draw_active_overlays ()
316+ $ HighlightsOverlay . queue_redraw ()
317317
318318
319319# Misc. useful functions
@@ -1270,7 +1270,6 @@ func undoredo_command(command : Dictionary) -> void:
12701270 get_node ("node_" + k ).do_set_position (command .positions [k ])
12711271 else :
12721272 parent_generator .get_node (k ).set_position (command .positions [k ])
1273- draw_active_overlays .call_deferred ()
12741273 "resize_comment" :
12751274 var g = get_node_from_hier_name (command .node )
12761275 g .size = command .size
@@ -1288,6 +1287,7 @@ func undoredo_command(command : Dictionary) -> void:
12881287 _ :
12891288 print ("Unknown undo/redo command:" )
12901289 print (command )
1290+ $ HighlightsOverlay .queue_redraw .call_deferred ()
12911291
12921292func undoredo_move_node (node_name : String , old_pos : Vector2 , new_pos : Vector2 ):
12931293 if old_pos == new_pos :
@@ -1765,32 +1765,6 @@ func color_comment_nodes() -> void:
17651765 picker .popup_hide .connect (undoredo .end_group )
17661766 picker .popup ()
17671767
1768- func draw_active_overlays () -> void :
1769- for node in get_children ():
1770- if node is Line2D :
1771- remove_child (node )
1772- node .free ()
1773- if active_connections .size () and should_draw_active_overlays :
1774- for line in active_connections :
1775- if has_node (NodePath (line.to_node)) and has_node (NodePath (line.to_node)):
1776- var from_node : GraphNode = get_node (NodePath (line.from_node))
1777- var to_node : GraphNode = get_node (NodePath (line.to_node))
1778- if from_node and to_node :
1779- var from_pos : Vector2 = from_node .get_output_port_position (line .from_port )* zoom + from_node .position
1780- var to_pos : Vector2 = to_node .get_input_port_position (line .to_port )* zoom + to_node .position
1781- var line2d : Line2D = Line2D .new ()
1782- if get_viewport_rect ().has_point (from_pos ) or get_viewport_rect ().has_point (to_pos ):
1783- var lm : ShaderMaterial = load ("res://material_maker/panels/graph_edit/active_connection_overlay.tres" )
1784- line2d .texture_mode = Line2D .LINE_TEXTURE_TILE
1785- line2d .material = lm .duplicate (true )
1786- line2d .material .set_shader_parameter ("dash_color" , to_node .get_input_port_color (line .to_port ))
1787- line2d .points = _get_connection_line (from_pos , to_pos )
1788- line2d .width = connection_lines_thickness
1789- line2d .round_precision = 4
1790- line2d .begin_cap_mode = Line2D .LINE_CAP_ROUND
1791- line2d .end_cap_mode = Line2D .LINE_CAP_ROUND
1792- add_child (line2d )
1793-
17941768func _on_connection_drag_started (_from_node : StringName , _from_port : int , _is_output : bool ) -> void :
17951769 active_connections .clear ()
17961770 should_draw_active_overlays = false
0 commit comments