diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-28 07:33:13 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-28 07:40:12 +0300 |
commit | 13f292d10d3bb19aa9aa694cecbde499f93e7a54 (patch) | |
tree | b12dffe51f9649c24642f18131b47bedca169438 /source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | |
parent | 2e22cfd08a0d589e8894e322ed29d5c3227ca04d (diff) |
Gizmo: only highlight when held modifier keys are used
Check the current events modifiers against the gizmo keymap,
only highlighting when keymap items match.
Needed to resolve T63996
Diffstat (limited to 'source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 56de2202731..20fe9728be7 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -679,6 +679,7 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap, const wmEvent *event, int *r_part) { + wmWindowManager *wm = CTX_wm_manager(C); wmGizmo *gz = NULL; BLI_buffer_declare_static(wmGizmo *, visible_3d_gizmos, BLI_BUFFER_NOP, 128); bool do_step[WM_GIZMOMAP_DRAWSTEP_MAX]; @@ -696,6 +697,8 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap, do_step[i] = WM_gizmo_context_check_drawstep(C, i); } + const int event_modifier = WM_event_modifier_flag(event); + for (wmGizmoGroup *gzgroup = gzmap->groups.first; gzgroup; gzgroup = gzgroup->next) { /* If it were important we could initialize here, @@ -721,10 +724,12 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap, /* cleared below */ } if (step == WM_GIZMOMAP_DRAWSTEP_3D) { - wm_gizmogroup_intersectable_gizmos_to_list(gzgroup, &visible_3d_gizmos); + wm_gizmogroup_intersectable_gizmos_to_list( + wm, gzgroup, event_modifier, &visible_3d_gizmos); } else if (step == WM_GIZMOMAP_DRAWSTEP_2D) { - if ((gz = wm_gizmogroup_find_intersected_gizmo(gzgroup, C, mval, r_part))) { + if ((gz = wm_gizmogroup_find_intersected_gizmo( + wm, gzgroup, C, event_modifier, mval, r_part))) { break; } } |