diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index b5aeee3d3bc..97d9b225d3c 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -9005,6 +9005,7 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi { int retval = WM_UI_HANDLER_CONTINUE; int type = event->type, val = event->val; + int scroll_dir = 1; bool redraw = false; uiList *ui_list = listbox->custom_data; @@ -9021,6 +9022,11 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi if (type == MOUSEPAN) { ui_pan_to_scroll(event, &type, &val); + /* 'ui_pan_to_scroll' gives the absolute direction. */ + if (event->is_direction_inverted) { + scroll_dir = -1; + } + /* If type still is mouse-pan, we call it handled, since delta-y accumulate. */ /* also see wm_event_system.c do_wheel_ui hack */ if (type == MOUSEPAN) { @@ -9115,7 +9121,7 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi else if (ELEM(type, WHEELUPMOUSE, WHEELDOWNMOUSE)) { if (dyn_data->height > dyn_data->visual_height) { /* list template will clamp */ - ui_list->list_scroll += (type == WHEELUPMOUSE) ? -1 : 1; + ui_list->list_scroll += scroll_dir * ((type == WHEELUPMOUSE) ? -1 : 1); redraw = true; retval = WM_UI_HANDLER_BREAK; |