summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-05-17 19:02:35 +0200
committerGitHub <noreply@github.com>2022-05-17 19:02:35 +0200
commit3ad751f7e0b2d5c2e6ae17872666f4967f5c955d (patch)
treeb7a77011f2d5bd778cfe9c0e24708173b1a89e82 /scene
parentabee814263c586d96b523b483bafb86d7a63aa58 (diff)
parent800d5567a1c6af124ce181007a4b01d949e83411 (diff)
Merge pull request #60867 from KoBeWi/μtext
Remove font height restriction from Button
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/button.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index ff194f979d..c54897035a 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;
}