From 1534da457efcd52d06b2a9c8a488fe26224974b5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 13 Apr 2021 21:33:52 +1000 Subject: Fix snap gizmo flickering while dragging Ignore click-drag for non-mouse button drag events Alternative to fix issue detailed in D10886. --- source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c | 2 +- source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager/gizmo') diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c index 32b6a6e6b31..ca1684811d5 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c @@ -592,7 +592,7 @@ static int gizmo_tweak_invoke(bContext *C, wmOperator *op, const wmEvent *event) const int highlight_part_init = gz->highlight_part; if (gz->drag_part != -1) { - if (ISTWEAK(event->type) || (event->val == KM_CLICK_DRAG)) { + if (WM_event_is_mouse_drag(event)) { gz->highlight_part = gz->drag_part; } } diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 45950a32d85..a6e2ba49fe2 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -735,7 +735,7 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap, /* 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 (ISTWEAK(event->type) || (event->val == KM_CLICK_DRAG)) { + if (WM_event_is_mouse_drag(event)) { mval[0] += event->x - event->prevclickx; mval[1] += event->y - event->prevclicky; } -- cgit v1.2.3