From d0fe99d8a24119e0a5e0783b9f00b6a71af783ba Mon Sep 17 00:00:00 2001 From: dominik Date: Fri, 20 Aug 2004 11:25:36 +0000 Subject: (svn r87) Fix: rare mousewheel scrolling with scrollbar crash --- window.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'window.c') diff --git a/window.c b/window.c index 106e1798d..9bd17934a 100644 --- a/window.c +++ b/window.c @@ -85,8 +85,7 @@ void DispatchRightClickEvent(Window *w, int x, int y) { void DispatchMouseWheelEvent(Window *w, int wheel) { - - if (w->vscroll.count) { + if (w->vscroll.count > w->vscroll.cap) { int pos = clamp(w->vscroll.pos + wheel, 0, w->vscroll.count - w->vscroll.cap); if (pos != w->vscroll.pos) { w->vscroll.pos = pos; -- cgit v1.2.3-54-g00ecf