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:
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c13
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_ruler.c4
2 files changed, 6 insertions, 11 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;
}
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
index 1b378397420..f3bc0a8a15b 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
@@ -57,7 +57,6 @@
#include "WM_api.h"
#include "WM_toolsystem.h"
#include "WM_types.h"
-#include "wm.h"
#include "DEG_depsgraph_query.h"
@@ -394,9 +393,6 @@ static bool view3d_ruler_item_mousemove(struct Depsgraph *depsgraph,
if (snap_elem) {
WM_gizmo_set_flag(snap_gizmo, WM_GIZMO_HIDDEN, false);
-
- /* Highlight snap_gizmo so that it is drawn. */
- wm_gizmomap_highlight_set(snap_gizmo->parent_gzgroup->parent_gzmap, NULL, snap_gizmo, 0);
}
}
return true;