From 14d28c5e699b8b8e82526e28e16e1d80cd0e7a28 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 25 Feb 2010 14:53:22 +0000 Subject: [PATCH] (svn r19250) -Fix [FS#3643]: with RTL languages clicking a horizontal scrollbar that could not scroll could cause a crash --- src/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index dbe971c62d..602759189e 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();