From 06b8625a83f539a81e7bbfd813e857307ae13378 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 2 Sep 2015 10:53:34 +0200 Subject: [PATCH] Fix scrolling with mouse wheel down when list is smaller than list box --- qcsrc/menu/item/listbox.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcsrc/menu/item/listbox.qc b/qcsrc/menu/item/listbox.qc index 6aead0a87..067234d3c 100644 --- a/qcsrc/menu/item/listbox.qc +++ b/qcsrc/menu/item/listbox.qc @@ -171,7 +171,7 @@ float ListBox_keyDown(entity me, float key, float ascii, float shift) } else if(key == K_MWHEELDOWN) { - me.scrollPosTarget = min(me.scrollPosTarget + 0.5, me.getTotalHeight(me) - 1); + me.scrollPosTarget = min(me.scrollPosTarget + 0.5, max(0, me.getTotalHeight(me) - 1)); } else if(key == K_PGUP || key == K_KP_PGUP) { -- 2.39.2