diff options
Diffstat (limited to 'source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index f1ac19f4651..d9f4050c8f1 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -815,6 +815,14 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap, BLI_buffer_declare_static(wmGizmo *, visible_3d_gizmos, BLI_BUFFER_NOP, 128); bool do_step[WM_GIZMOMAP_DRAWSTEP_MAX]; + int mval[2]; + if (event->val == KM_CLICK_DRAG) { + WM_event_drag_start_mval(event, CTX_wm_region(C), mval); + } + else { + copy_v2_v2_int(mval, event->mval); + } + for (int i = 0; i < ARRAY_SIZE(do_step); i++) { do_step[i] = WM_gizmo_context_check_drawstep(C, i); } @@ -841,7 +849,7 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap, } else if (step == WM_GIZMOMAP_DRAWSTEP_2D) { if ((gz = wm_gizmogroup_find_intersected_gizmo( - wm, gzgroup, C, event->modifier, event->mval, r_part))) { + wm, gzgroup, C, event->modifier, mval, r_part))) { break; } } @@ -853,7 +861,7 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap, /* 2D gizmos get priority. */ if (gz == NULL) { gz = gizmo_find_intersected_3d( - C, event->mval, visible_3d_gizmos.data, visible_3d_gizmos.count, r_part); + C, mval, visible_3d_gizmos.data, visible_3d_gizmos.count, r_part); } } BLI_buffer_free(&visible_3d_gizmos); @@ -1149,7 +1157,7 @@ void wm_gizmomap_modal_set( struct wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, gz->highlight_part); if (gzop && gzop->type) { - const int retval = WM_gizmo_operator_invoke(C, gz, gzop); + const int retval = WM_gizmo_operator_invoke(C, gz, gzop, event); if ((retval & OPERATOR_RUNNING_MODAL) == 0) { wm_gizmomap_modal_set(gzmap, C, gz, event, false); } |