summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--window.c3
1 files changed, 1 insertions, 2 deletions
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;