From fa4b2d25cb32caba2ccd90603a6fc02d84e437d0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Apr 2021 00:18:48 +1000 Subject: WM: remove redundant click-drag offset for gizmo highlight checking Tweak and click-drag events already apply this offset, this was a no-op. --- source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index a6e2ba49fe2..611a9cba000 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -731,15 +731,6 @@ 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] = {UNPACK2(event->mval)}; - - /* Ensure for drag events we use the location where the user clicked. - * Without this click-dragging on a gizmo can accidentally act on the wrong gizmo. */ - if (WM_event_is_mouse_drag(event)) { - mval[0] += event->x - event->prevclickx; - mval[1] += event->y - event->prevclicky; - } - for (int i = 0; i < ARRAY_SIZE(do_step); i++) { do_step[i] = WM_gizmo_context_check_drawstep(C, i); } @@ -775,7 +766,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, mval, r_part))) { + wm, gzgroup, C, event_modifier, event->mval, r_part))) { break; } } @@ -787,7 +778,7 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap, /* 2D gizmos get priority. */ if (gz == NULL) { gz = gizmo_find_intersected_3d( - C, mval, visible_3d_gizmos.data, visible_3d_gizmos.count, r_part); + C, event->mval, visible_3d_gizmos.data, visible_3d_gizmos.count, r_part); } } BLI_buffer_free(&visible_3d_gizmos); -- cgit v1.2.3