mirror of https://github.com/OpenTTD/OpenTTD.git
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:
parent
a60a81f34e
commit
a66b4f33d1
|
@ -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()) {
|
||||
|
|
Loading…
Reference in New Issue