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:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-05-27 20:27:28 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-05-27 20:27:37 +0300
commit80d6421f28474eff0ac491d6a873cdaa9c34db5b (patch)
treee0c0665acb6b52b40732494650fbb22b628ed598 /source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
parent0b793514fabec9e29b6c72b6ebe3aeebd42416d4 (diff)
Ruler: Remove highlight hack
Diffstat (limited to 'source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c')
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c13
1 files changed, 6 insertions, 7 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 b8d6d64ae8a..8c03fe764c2 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
@@ -50,6 +50,7 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "wm.h"
/* own includes */
#include "../gizmo_geometry.h"
@@ -341,16 +342,14 @@ static void gizmo_snap_draw(const bContext *C, wmGizmo *gz)
return;
}
+ ARegion *region = CTX_wm_region(C);
+ RegionView3D *rv3d = region->regiondata;
+
/* Ideally, we shouldn't assign values here.
* But `test_select` is not called during navigation.
* And `snap_elem` is not really useful in this case. */
- if ((gz->state & WM_GIZMO_STATE_HIGHLIGHT) == 0) {
- gizmo_snap->snap_elem = 0;
- return;
- }
-
- RegionView3D *rv3d = CTX_wm_region_view3d(C);
- if (rv3d->rflag & RV3D_NAVIGATING) {
+ if ((rv3d->rflag & RV3D_NAVIGATING) ||
+ (!(gz->state & WM_GIZMO_STATE_HIGHLIGHT) && !wm_gizmomap_modal_get(region->gizmo_map))) {
gizmo_snap->snap_elem = 0;
return;
}