diff options
author | kobewi <kobewi4e@gmail.com> | 2022-05-08 00:25:35 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-05-08 13:33:57 +0200 |
commit | 800d5567a1c6af124ce181007a4b01d949e83411 (patch) | |
tree | 891d1e741743955679eca73a4230cb7ca0225869 | |
parent | 563690347a6b9da4882bca15ebd9f3d79f30d3e6 (diff) |
Remove font height restriction from Button
-rw-r--r-- | scene/gui/button.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index b7c1e674dd..e294060bbd 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -60,11 +60,11 @@ Size2 Button::get_minimum_size() const { } } } - - Ref<Font> font = get_theme_font(SNAME("font")); - float font_height = font->get_height(get_theme_font_size(SNAME("font_size"))); - - minsize.height = MAX(font_height, minsize.height); + if (!xl_text.is_empty()) { + Ref<Font> font = get_theme_font(SNAME("font")); + float font_height = font->get_height(get_theme_font_size(SNAME("font_size"))); + minsize.height = MAX(font_height, minsize.height); + } return get_theme_stylebox(SNAME("normal"))->get_minimum_size() + minsize; } |