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.
This commit is contained in:
Peter Nelson 2024-04-25 17:44:38 +01:00
parent a60a81f34e
commit a66b4f33d1
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 1 additions and 1 deletions

View File

@ -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()) {