diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-30 16:13:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-30 16:13:34 +0300 |
commit | 8f27ea40d637d1b9545ad2a911cdb100230666e2 (patch) | |
tree | 36533f4071f3670227cf1abc5d918aab68f813e4 /source/blender/editors/gizmo_library | |
parent | 95d2d0d35a6644c57fef4665a14d17a482dc3e07 (diff) | |
parent | 0d07cfd9405464e45186c3c075f255ff519f1d24 (diff) |
Merge branch 'blender-v2.93-release'
Diffstat (limited to 'source/blender/editors/gizmo_library')
-rw-r--r-- | source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c index e2f3c352676..b2d3a2e1576 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c @@ -627,12 +627,23 @@ static int snap_gizmo_test_select(bContext *C, wmGizmo *gz, const int mval[2]) { SnapGizmo3D *snap_gizmo = (SnapGizmo3D *)gz; wmWindowManager *wm = CTX_wm_manager(C); + ARegion *region = CTX_wm_region(C); + + /* FIXME: this hack is to ignore drag events, otherwise drag events + * cause momentary snap gizmo re-positioning at the drag-start location, see: T87511. */ + if (wm && wm->winactive) { + const wmEvent *event = wm->winactive->eventstate; + int mval_compare[2] = {event->x - region->winrct.xmin, event->y - region->winrct.ymin}; + if (!equals_v2v2_int(mval_compare, mval)) { + return snap_gizmo->snap_elem ? 0 : -1; + } + } + if (!eventstate_has_changed(snap_gizmo, wm)) { /* Performance, do not update. */ return snap_gizmo->snap_elem ? 0 : -1; } - ARegion *region = CTX_wm_region(C); View3D *v3d = CTX_wm_view3d(C); const float mval_fl[2] = {UNPACK2(mval)}; short snap_elem = ED_gizmotypes_snap_3d_update( |