diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-11-02 06:41:41 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-11-02 06:43:48 +0300 |
commit | 24310441ddc85ecc8dc857ccc75b508db59bd844 (patch) | |
tree | 9a87e2ff0750f171d5ffecdbd317af83d452f313 /source/blender/editors/gizmo_library | |
parent | 348d7c35a9f9ffb56e716430100a3d167884889c (diff) |
Fix snap cursor still active even when gizmo is not available
The snap cursor continued to appear even when the workspace is changed for example.
So add the region to check in the cursor pool.
Diffstat (limited to 'source/blender/editors/gizmo_library')
-rw-r--r-- | source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c | 5 |
1 files changed, 4 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 93ee6ec2d81..60642158820 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c @@ -241,6 +241,10 @@ static void snap_gizmo_draw(const bContext *UNUSED(C), wmGizmo *UNUSED(gz)) static int snap_gizmo_test_select(bContext *C, wmGizmo *gz, const int mval[2]) { SnapGizmo3D *snap_gizmo = (SnapGizmo3D *)gz; + ARegion *region = CTX_wm_region(C); + + /* Make sure the cursor is only drawn in the gizmo region. */ + snap_gizmo->snap_state->region = region; /* Snap Elements can change while the gizmo is active. Need to be updated somewhere. */ snap_gizmo_snap_elements_update(snap_gizmo); @@ -251,7 +255,6 @@ static int snap_gizmo_test_select(bContext *C, wmGizmo *gz, const int mval[2]) wmWindowManager *wm = CTX_wm_manager(C); const wmEvent *event = wm->winactive ? wm->winactive->eventstate : NULL; if (event) { - ARegion *region = CTX_wm_region(C); x = event->xy[0] - region->winrct.xmin; y = event->xy[1] - region->winrct.ymin; } |