mirror of https://github.com/OpenTTD/OpenTTD
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.pull/12580/head
parent
a60a81f34e
commit
a66b4f33d1
|
@ -839,7 +839,7 @@ public:
|
||||||
*/
|
*/
|
||||||
void ScrollTowards(size_type position)
|
void ScrollTowards(size_type position)
|
||||||
{
|
{
|
||||||
if (position < this->GetPosition()) {
|
if (position <= this->GetPosition()) {
|
||||||
/* scroll up to the item */
|
/* scroll up to the item */
|
||||||
this->SetPosition(position);
|
this->SetPosition(position);
|
||||||
} else if (position >= this->GetPosition() + this->GetCapacity()) {
|
} else if (position >= this->GetPosition() + this->GetCapacity()) {
|
||||||
|
|
Loading…
Reference in New Issue