Ruler: Remove highlight hack
This commit is contained in:
parent
0b793514fa
commit
80d6421f28
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue