Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-04-16 17:18:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-04-16 17:20:19 +0300
commitfa4b2d25cb32caba2ccd90603a6fc02d84e437d0 (patch)
tree2a81c17bb6e70713201cc272c89b09651b7a114e
parent7bbead1e87254623deed56f588e65f524d14343b (diff)
WM: remove redundant click-drag offset for gizmo highlight checking
Tweak and click-drag events already apply this offset, this was a no-op.
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c13
1 files changed, 2 insertions, 11 deletions
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);