Could scroll outside the list area

This commit is contained in:
Henrik Rydgård committed 2012-10-31 13:39:27 +01:00
1 parent e3335b5817
commit 78239e7796
1 file changed
+2 -1
+2 -1
View File
@@ -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);
}