From f8f83f05f2da8761327a3fe09338ce7c475a46f9 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:53:52 +0200 Subject: [PATCH] Fix RichTextLabel uninitialized content height value. --- scene/gui/rich_text_label.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 061bf9287a2..c14b8eb48ff 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -2705,6 +2705,7 @@ void RichTextLabel::install_effect(const Variant effect) { int RichTextLabel::get_content_height() const { int total_height = 0; + const_cast(this)->_validate_line_caches(main); if (main->lines.size()) { total_height = main->lines[main->lines.size() - 1].height_accum_cache + get_stylebox("normal")->get_minimum_size().height; } @@ -2886,7 +2887,6 @@ Size2 RichTextLabel::get_minimum_size() const { } if (fixed_width != -1 || fit_content_height) { - const_cast(this)->_validate_line_caches(main); size.y = get_content_height(); }