From 45bde2b5b0e3970e889020b1c8baf38d51cafa77 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:48:46 +0300 Subject: [PATCH] [Button] Fix theme elements size rounding errors not keeping sufficient space for the text. --- scene/gui/button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index b1870eea553..ad3f6076618 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;