summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-13 17:18:28 +0100
committerGitHub <noreply@github.com>2022-03-13 17:18:28 +0100
commit0dc6dab28deb9fab467ea75197cae3a970de6f81 (patch)
tree227d5f0b911d8d2195720382f4e8fcb20174524e /scene
parent1164d083d268187932e3a21215e170235a52621f (diff)
parentaada3953543b7a70ad4b92bbcaa35efae7bc9799 (diff)
Merge pull request #59112 from bruvzg/right_clip
Diffstat (limited to 'scene')
-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 724714b93b..29a0681f9c 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -293,7 +293,7 @@ void Button::_notification(int p_what) {
int text_clip = size.width - style->get_minimum_size().width - icon_ofs.width;
text_buf->set_width(clip_text ? text_clip : -1);
- int text_width = clip_text ? MIN(text_clip, text_buf->get_size().x) : text_buf->get_size().x;
+ int text_width = MAX(1, clip_text ? MIN(text_clip, text_buf->get_size().x) : text_buf->get_size().x);
if (_internal_margin[SIDE_LEFT] > 0) {
text_clip -= _internal_margin[SIDE_LEFT] + get_theme_constant(SNAME("hseparation"));