1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

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.
This commit is contained in:
reduz
2021-02-22 10:54:12 -03:00
parent 98c63389d1
commit d6a9cff8b7
7 changed files with 573 additions and 32 deletions

View File

@@ -56,6 +56,11 @@ Size2 Button::get_minimum_size() const {
}
}
Ref<Font> 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;
}