Skip to content

Commit c1f8d24

Browse files
committed
Merge pull request #91275 from ajreckof/Fix-RichTextLabel-Scroll-Following-randomly-stops-working
Fix RichTextLabel "Scroll Following" randomly stops working.
2 parents 78f03f8 + 7faafb1 commit c1f8d24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scene/gui/rich_text_label.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ void RichTextLabel::_scroll_changed(double) {
18031803
return;
18041804
}
18051805

1806-
if (scroll_follow && vscroll->get_value() >= (vscroll->get_max() - Math::round(vscroll->get_page()))) {
1806+
if (scroll_follow && vscroll->get_value() > (vscroll->get_max() - vscroll->get_page() - 1)) {
18071807
scroll_following = true;
18081808
} else {
18091809
scroll_following = false;
@@ -4121,7 +4121,7 @@ bool RichTextLabel::is_scroll_active() const {
41214121

41224122
void RichTextLabel::set_scroll_follow(bool p_follow) {
41234123
scroll_follow = p_follow;
4124-
if (!vscroll->is_visible_in_tree() || vscroll->get_value() >= (vscroll->get_max() - vscroll->get_page())) {
4124+
if (!vscroll->is_visible_in_tree() || vscroll->get_value() > (vscroll->get_max() - vscroll->get_page() - 1)) {
41254125
scroll_following = true;
41264126
}
41274127
}

0 commit comments

Comments
 (0)