From 5e122d9bb0c1ac3f02176e71c0c752e5190c307f Mon Sep 17 00:00:00 2001 From: Snaiel <56014779+Snaiel@users.noreply.github.com> Date: Thu, 27 Jun 2024 01:50:19 +0800 Subject: [PATCH] check font and queue_free titlebar child fixes failed debugger_test.gd case and orphans --- addons/beehave/debug/new_graph_node.gd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/beehave/debug/new_graph_node.gd b/addons/beehave/debug/new_graph_node.gd index a242b03..70f06dc 100644 --- a/addons/beehave/debug/new_graph_node.gd +++ b/addons/beehave/debug/new_graph_node.gd @@ -62,14 +62,17 @@ func _ready() -> void: icon_rect.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED titlebar_hbox = get_titlebar_hbox() - titlebar_hbox.remove_child(titlebar_hbox.get_child(0)) + titlebar_hbox.get_child(0).queue_free() titlebar_hbox.alignment = BoxContainer.ALIGNMENT_BEGIN titlebar_hbox.add_child(icon_rect) title_label = Label.new() title_label.add_theme_color_override("font_color", Color.WHITE) - var title_font: FontVariation = get_theme_font("title_font").duplicate() - title_font.variation_embolden = 1 + var title_font: Font = get_theme_font("title_font").duplicate() + if title_font is FontVariation: + title_font.variation_embolden = 1 + elif title_font is FontFile: + title_font.font_weight = 700 title_label.add_theme_font_override("font", title_font) title_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER title_label.size_flags_horizontal = Control.SIZE_EXPAND_FILL