From 3ccabee9ae8f261aa7b0110482fbb5d2500d2e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Mon, 13 Feb 2023 18:46:56 +0100 Subject: [PATCH] Fix blank non-autowrapping labels --- scene/gui/label.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 829f4cc643e..c0ef71ee4fc 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -177,6 +177,10 @@ void Label::_shape() { minsize.width = TS->shaped_text_get_size(lines_rid[i]).x; } } + + // With autowrap off, by now we already know the width the label will take. + width = (minsize.width - style->get_minimum_size().width); + width_stabilized = true; } if (lines_dirty && width_stabilized) {