[Bf-blender-cvs] [fa4b2d25cb3] blender-v2.93-release: WM: remove redundant click-drag offset for gizmo highlight checking

Campbell Barton noreply at git.blender.org
Fri Apr 16 16:21:04 CEST 2021


Commit: fa4b2d25cb32caba2ccd90603a6fc02d84e437d0
Author: Campbell Barton
Date:   Sat Apr 17 00:18:48 2021 +1000
Branches: blender-v2.93-release
https://developer.blender.org/rBfa4b2d25cb32caba2ccd90603a6fc02d84e437d0

WM: remove redundant click-drag offset for gizmo highlight checking

Tweak and click-drag events already apply this offset, this was a no-op.

===================================================================

M	source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list