summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2023-02-13 18:46:56 +0100
committerPedro J. Estébanez <pedrojrulez@gmail.com>2023-02-13 18:46:56 +0100
commit3ccabee9ae8f261aa7b0110482fbb5d2500d2e38 (patch)
tree716cdf88d7c174ce359afb71e271c620649d0341
parent4a2c2170b40b4e5562c9ad0f1e0ed84c6bf5c7b7 (diff)
Fix blank non-autowrapping labels
-rw-r--r--scene/gui/label.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 829f4cc643..c0ef71ee4f 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) {