From 7faafb144806ef47a48debebe37f63fbe521014d Mon Sep 17 00:00:00 2001 From: ajreckof Date: Sun, 28 Apr 2024 09:27:56 +0200 Subject: [PATCH] Fix RichTextLabel "Scroll Following" randomly stops working. --- scene/gui/rich_text_label.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index e177bed20a8..99fb78d218a 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1803,7 +1803,7 @@ void RichTextLabel::_scroll_changed(double) { return; } - if (scroll_follow && vscroll->get_value() >= (vscroll->get_max() - Math::round(vscroll->get_page()))) { + if (scroll_follow && vscroll->get_value() > (vscroll->get_max() - vscroll->get_page() - 1)) { scroll_following = true; } else { scroll_following = false; @@ -4121,7 +4121,7 @@ bool RichTextLabel::is_scroll_active() const { void RichTextLabel::set_scroll_follow(bool p_follow) { scroll_follow = p_follow; - if (!vscroll->is_visible_in_tree() || vscroll->get_value() >= (vscroll->get_max() - vscroll->get_page())) { + if (!vscroll->is_visible_in_tree() || vscroll->get_value() > (vscroll->get_max() - vscroll->get_page() - 1)) { scroll_following = true; } }