summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-02-25 14:53:22 +0000
committerrubidium <rubidium@openttd.org>2010-02-25 14:53:22 +0000
commit14d28c5e699b8b8e82526e28e16e1d80cd0e7a28 (patch)
treebf135048fb01f501716737848470dd816abca20d /src
parent1ad5e1cece4b14d43d3e2600f87c17a11d25c808 (diff)
downloadopenttd-14d28c5e699b8b8e82526e28e16e1d80cd0e7a28.tar.xz
(svn r19250) -Fix [FS#3643]: with RTL languages clicking a horizontal scrollbar that could not scroll could cause a crash
Diffstat (limited to 'src')
-rw-r--r--src/window.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/window.cpp b/src/window.cpp
index dbe971c62..602759189 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -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();