From a66b4f33d1c9819be5c3ea3971f86db9315eab1e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 25 Apr 2024 17:44:38 +0100 Subject: [PATCH] Fix: Scrollbar scrolls to wrong position for current position. Scrollbar::ScrollTowards() incorrectly scrolls downwards if the current position is the same as the request position, so that the position is no longer visible. --- src/widget_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget_type.h b/src/widget_type.h index 8655dd2d1d..abf212a2fa 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -839,7 +839,7 @@ public: */ void ScrollTowards(size_type position) { - if (position < this->GetPosition()) { + if (position <= this->GetPosition()) { /* scroll up to the item */ this->SetPosition(position); } else if (position >= this->GetPosition() + this->GetCapacity()) {