Fix disappearing snap indication in Measure tool

Snap cursor disappeared while dragging.

Regression in 2b32a2c3b
This commit is contained in:
Germano Cavalcante 2023-01-11 23:00:51 -03:00
parent 2b4bf586ad
commit 0349a6e6e0
Notes: blender-bot 2023-05-11 13:04:56 +02:00
Referenced by issue #107830, Regression: Missing snap gizmo in multiple viewport instances
2 changed files with 6 additions and 2 deletions

View File

@ -242,7 +242,8 @@ static void snap_cursor_free(SnapGizmo3D *snap_gizmo)
static bool snap_cursor_poll(ARegion *region, void *data)
{
SnapGizmo3D *snap_gizmo = (SnapGizmo3D *)data;
if (!(snap_gizmo->gizmo.state & WM_GIZMO_STATE_HIGHLIGHT)) {
if (!(snap_gizmo->gizmo.state & WM_GIZMO_STATE_HIGHLIGHT) &&
!(snap_gizmo->gizmo.flag & WM_GIZMO_DRAW_VALUE)) {
return false;
}

View File

@ -301,10 +301,13 @@ static void ruler_state_set(RulerInfo *ruler_info, int state)
}
if (state == RULER_STATE_NORMAL) {
/* pass */
WM_gizmo_set_flag(ruler_info->snap_data.gizmo, WM_GIZMO_DRAW_VALUE, false);
}
else if (state == RULER_STATE_DRAG) {
memset(&ruler_info->drag_state_prev, 0x0, sizeof(ruler_info->drag_state_prev));
/* Force the snap cursor to appear even though it is not highlighted. */
WM_gizmo_set_flag(ruler_info->snap_data.gizmo, WM_GIZMO_DRAW_VALUE, true);
}
else {
BLI_assert(0);