mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-11 16:54:42 +00:00
Fix: Clicking on scrollbar 'thumb' moved position up instantly.
This commit is contained in:
parent
8fc2b48db7
commit
82989ef076
@ -2414,7 +2414,7 @@ static void HandleScrollbarScrolling(Window *w)
|
||||
}
|
||||
|
||||
/* Find the item we want to move to and make sure it's inside bounds. */
|
||||
int pos = min(max(0, i + _scrollbar_start_pos) * sb->GetCount() / _scrollbar_size, max(0, sb->GetCount() - sb->GetCapacity()));
|
||||
int pos = min(RoundDivSU(max(0, i + _scrollbar_start_pos) * sb->GetCount(), _scrollbar_size), max(0, sb->GetCount() - sb->GetCapacity()));
|
||||
if (rtl) pos = max(0, sb->GetCount() - sb->GetCapacity() - pos);
|
||||
if (pos != sb->GetPosition()) {
|
||||
sb->SetPosition(pos);
|
||||
|
Loading…
Reference in New Issue
Block a user