mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 07:29:44 +00:00
(svn r19250) -Fix [FS#3643]: with RTL languages clicking a horizontal scrollbar that could not scroll could cause a crash
This commit is contained in:
parent
1ad5e1cece
commit
14d28c5e69
@ -1757,7 +1757,7 @@ static bool HandleScrollbarScrolling()
|
||||
|
||||
/* 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()));
|
||||
if (rtl) pos = sb->GetCount() - sb->GetCapacity() - pos;
|
||||
if (rtl) pos = max(0, sb->GetCount() - sb->GetCapacity() - pos);
|
||||
if (pos != sb->GetPosition()) {
|
||||
sb->SetPosition(pos);
|
||||
w->SetDirty();
|
||||
|
Loading…
Reference in New Issue
Block a user