mirror of
https://github.com/godotengine/godot.git
synced 2025-02-11 05:10:54 +00:00
Merge pull request #24112 from allkhor/rich_label_update_cache
RichTextLabel: update the cache when the scroll hide.
This commit is contained in:
commit
e6b0327c2c
@ -765,19 +765,17 @@ void RichTextLabel::_update_scroll() {
|
|||||||
|
|
||||||
if (exceeds) {
|
if (exceeds) {
|
||||||
scroll_visible = true;
|
scroll_visible = true;
|
||||||
main->first_invalid_line = 0;
|
|
||||||
scroll_w = vscroll->get_combined_minimum_size().width;
|
scroll_w = vscroll->get_combined_minimum_size().width;
|
||||||
vscroll->show();
|
vscroll->show();
|
||||||
vscroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -scroll_w);
|
vscroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -scroll_w);
|
||||||
_validate_line_caches(main);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
scroll_visible = false;
|
scroll_visible = false;
|
||||||
vscroll->hide();
|
|
||||||
scroll_w = 0;
|
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.clear();
|
||||||
main->lines.resize(1);
|
main->lines.resize(1);
|
||||||
main->first_invalid_line = 0;
|
main->first_invalid_line = 0;
|
||||||
scroll_w = 0;
|
|
||||||
update();
|
update();
|
||||||
selection.click = NULL;
|
selection.click = NULL;
|
||||||
selection.active = false;
|
selection.active = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user