summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorallkhor <say2word@gmail.com>2018-12-02 05:06:38 +0600
committerallkhor <say2word@gmail.com>2018-12-02 05:06:38 +0600
commitc80b9e9173bdac27f98330b8f4a86f839041e3f2 (patch)
tree718325c70c32c4a417b1cee983a0581edb56f71e /scene
parentca28c455bfdc8408485c217c17f07011c0b43f64 (diff)
RichTextLabel: update the cache when the scroll hide.
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/rich_text_label.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 17de346f51..490013d813 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -765,19 +765,17 @@ void RichTextLabel::_update_scroll() {
if (exceeds) {
scroll_visible = true;
- main->first_invalid_line = 0;
scroll_w = vscroll->get_combined_minimum_size().width;
vscroll->show();
vscroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -scroll_w);
- _validate_line_caches(main);
-
} else {
-
scroll_visible = false;
- vscroll->hide();
scroll_w = 0;
- _validate_line_caches(main);
+ vscroll->hide();
}
+
+ main->first_invalid_line = 0; //invalidate ALL
+ _validate_line_caches(main);
}
}
@@ -1616,7 +1614,6 @@ void RichTextLabel::clear() {
main->lines.clear();
main->lines.resize(1);
main->first_invalid_line = 0;
- scroll_w = 0;
update();
selection.click = NULL;
selection.active = false;