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); }