changeset 12907:e9cf7bf2bbbd draft

(svn r17399) -Fix (r17365): if scrollbar has more capacity than elements clicking on the "scroll down" button asserted (esminis)
author rubidium <rubidium@openttd.org>
date Thu, 03 Sep 2009 09:07:14 +0000
parents 44894efb3032
children 730eacf8ad29
files src/window_gui.h
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -287,7 +287,7 @@
 	void UpdatePosition(int difference)
 	{
 		if (difference == 0) return;
-		this->SetPosition(Clamp(this->pos + difference, 0, this->count - this->cap));
+		this->SetPosition(Clamp(this->pos + difference, 0, max(this->count - this->cap, 0)));
 	}
 
 	/**