diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-03 20:57:06 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-03 20:57:06 +0300 |
commit | 9d902d1b30f828d6861e38a3afd068ec5dcecd21 (patch) | |
tree | ff2a7ff90ad59b18f54d82d7d1bc2c80f33c40cd /source/blender/editors/interface | |
parent | dcb2821292f962951e88f146cb304160f21f73da (diff) | |
parent | 5eb5a7f4b7d7c5228ec9596b35e7f2e317aad97d (diff) |
Merge branch 'blender-v2.92-release'
# Conflicts:
# source/blender/editors/transform/transform_constraints.c
Diffstat (limited to 'source/blender/editors/interface')
-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 d246dfadefa..9ee625fc02e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -9014,6 +9014,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; @@ -9030,6 +9031,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) { @@ -9124,7 +9130,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; |