diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-18 12:25:05 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-18 12:25:05 +0200 |
commit | a202027efe61d0e26d6749beea83081570b5e9f3 (patch) | |
tree | 204c10aff4c225a612caeae889d92499097ee0eb | |
parent | 1ebdacb4b02983cbb9897440249140806efd71a8 (diff) | |
parent | 45bde2b5b0e3970e889020b1c8baf38d51cafa77 (diff) | |
download | redot-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.cpp | 2 |
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; |