summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-24 09:49:00 +0200
committerGitHub <noreply@github.com>2022-08-24 09:49:00 +0200
commit854eb58074e2aa25a0f7b65b1833dc2dc51e49a6 (patch)
tree8017e01c604c9e0a7b627b40d43ffb0d3496ee80
parent792f7cc28c346a06564f6da54520cb02a837f04d (diff)
parentf02d45ce0c35c9cd98fb4bee8456a97e9e0927ac (diff)
Merge pull request #64783 from bruvzg/fix_rtl_min_size
Fix RTL min. size not triggering text cache update.
-rw-r--r--scene/gui/rich_text_label.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index ea080a8954..381baec38d 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -4328,6 +4328,8 @@ void RichTextLabel::append_text(const String &p_bbcode) {
}
void RichTextLabel::scroll_to_paragraph(int p_paragraph) {
+ _validate_line_caches();
+
if (p_paragraph <= 0) {
vscroll->set_value(0);
} else if (p_paragraph >= main->first_invalid_line.load()) {
@@ -4349,6 +4351,8 @@ int RichTextLabel::get_visible_paragraph_count() const {
}
void RichTextLabel::scroll_to_line(int p_line) {
+ _validate_line_caches();
+
if (p_line <= 0) {
vscroll->set_value(0);
return;
@@ -4966,6 +4970,8 @@ void RichTextLabel::install_effect(const Variant effect) {
}
int RichTextLabel::get_content_height() const {
+ const_cast<RichTextLabel *>(this)->_validate_line_caches();
+
int total_height = 0;
int to_line = main->first_invalid_line.load();
if (to_line) {
@@ -4976,6 +4982,8 @@ int RichTextLabel::get_content_height() const {
}
int RichTextLabel::get_content_width() const {
+ const_cast<RichTextLabel *>(this)->_validate_line_caches();
+
int total_width = 0;
int to_line = main->first_invalid_line.load();
for (int i = 0; i < to_line; i++) {