From 78239e7796fabc80f9972be9d7eb8cb722cfb598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 31 Oct 2012 13:39:27 +0100 Subject: [PATCH] Could scroll outside the list area --- ui/ui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/ui.cpp b/ui/ui.cpp index 11f682c653..02b6da0adb 100644 --- a/ui/ui.cpp +++ b/ui/ui.cpp @@ -341,10 +341,11 @@ int UIList::Do(int id, int x, int y, int w, int h, UIListAdapter *adapter) { if (inertiaY > 20) inertiaY = 20; if (inertiaY < -20) inertiaY = -20; + float mouseY = uistate.mousey[0]; if (!uistate.mousedown[0]) { // Let it slide if the pointer is not down scrollY += inertiaY; - } else if (scrolling) { + } else if (scrolling && mouseY > y && mouseY < y + h) { // Pointer is down so stick to it scrollY = startScrollY - (uistate.mousey[0] - startDragY); }