From d6a9cff8b7cbacec81a924c65a02736a5dba9b53 Mon Sep 17 00:00:00 2001 From: reduz Date: Mon, 22 Feb 2021 10:54:12 -0300 Subject: Add preview Sun and Environment * Adds both a preview sun and preview environment to the 3D editor. * They are valid as long as a DirectionalLight3D and WorldEnvironment are not in the scene. * If any is added to the scene, the respective preview is disabled. * Changed WorldEnvironment to better handle multiple node versions. * Added a function in SceneTree to get the first node in a group. * Fixed button minimum size to also consider font height if no text is there, this broke with the TextSever PR. --- scene/gui/button.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scene/gui') diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 37bb17b47d..b0bcde8865 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -56,6 +56,11 @@ Size2 Button::get_minimum_size() const { } } + Ref font = get_theme_font("font"); + float font_height = font->get_height(get_theme_font_size("font_size")); + + minsize.height = MAX(font_height, minsize.height); + return get_theme_stylebox("normal")->get_minimum_size() + minsize; } -- cgit v1.2.3