summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-04-18 12:25:05 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-04-18 12:25:05 +0200
commita202027efe61d0e26d6749beea83081570b5e9f3 (patch)
tree204c10aff4c225a612caeae889d92499097ee0eb
parent1ebdacb4b02983cbb9897440249140806efd71a8 (diff)
parent45bde2b5b0e3970e889020b1c8baf38d51cafa77 (diff)
downloadredot-engine-a202027efe61d0e26d6749beea83081570b5e9f3.tar.gz
Merge pull request #90838 from bruvzg/btn_theme_rounding
[Button] Fix theme elements size rounding errors not keeping sufficient space for the text.
-rw-r--r--scene/gui/button.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index b1870eea55..ad3f607661 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -358,7 +358,7 @@ void Button::_notification(int p_what) {
if (!xl_text.is_empty()) {
text_buf->set_alignment(align_rtl_checked);
- float text_buf_width = MAX(1.0f, drawable_size_remained.width); // The space's width filled by the text_buf.
+ float text_buf_width = Math::ceil(MAX(1.0f, drawable_size_remained.width)); // The space's width filled by the text_buf.
text_buf->set_width(text_buf_width);
Point2 text_ofs;