Skip to content

Commit

Permalink
Fix RichTextLabel "Scroll Following" randomly stops working.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreckof committed Apr 28, 2024
1 parent 6118592 commit 7faafb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 7faafb1

Please sign in to comment.