From e8f3bebb5dd2438111ddf7cecb612a285330a8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Mon, 2 Dec 2024 07:57:00 +0200 Subject: [PATCH] [Label] Fix min. width --- scene/gui/label.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 7dd24cc14d3..8ccaf99dfbf 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -215,9 +215,11 @@ void Label::_shape() { bool lines_hidden = visible_lines > 0 && visible_lines < total_line_count; int line_index = 0; + if (autowrap_mode == TextServer::AUTOWRAP_OFF) { + minsize.width = 0.0f; + } for (Paragraph ¶ : paragraphs) { if (autowrap_mode == TextServer::AUTOWRAP_OFF) { - minsize.width = 0.0f; for (const RID &line_rid : para.lines_rid) { if (minsize.width < TS->shaped_text_get_size(line_rid).x) { minsize.width = TS->shaped_text_get_size(line_rid).x;