Commit: 80d6421f28474eff0ac491d6a873cdaa9c34db5b
Author: Germano Cavalcante
Date:   Wed May 27 14:27:28 2020 -0300
Branches: master
https://developer.blender.org/rB80d6421f28474eff0ac491d6a873cdaa9c34db5b

Ruler: Remove highlight hack

===================================================================

M       source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
M       source/blender/editors/space_view3d/view3d_gizmo_ruler.c

===================================================================

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;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to