1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-28 17:09:10 +00:00

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:
2024-04-25 17:44:38 +01:00
parent a60a81f34e
commit a66b4f33d1

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