diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-11-04 10:03:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-11-04 10:08:23 +0300 |
commit | 08c4f134d290be0229d4cc1cabcaa595efe93360 (patch) | |
tree | 6c012ec7f8f5617652db37a70865e2bf9472429c /source/blender/windowmanager | |
parent | b849f290c5a9f1db2e6067855934a75697ec2db2 (diff) |
Fix T92783: Light size controller doesn't update position
Resolve by tagging the gizmo group map for refresh
when the modal gizmo group changes.
Regression in fb27a9bb983ce74b8d8f5f871cf0706dd1e25051.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 18e1a8420a6..6f952bc9526 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -743,14 +743,7 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap, } if (WM_gizmo_group_type_poll(C, gzgroup->type)) { - eWM_GizmoFlagMapDrawStep step; - if (gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) { - step = WM_GIZMOMAP_DRAWSTEP_3D; - } - else { - step = WM_GIZMOMAP_DRAWSTEP_2D; - } - + const eWM_GizmoFlagMapDrawStep step = WM_gizmomap_drawstep_from_gizmo_group(gzgroup); if (do_step[step]) { if (gzmap->update_flag[step] & GIZMOMAP_IS_REFRESH_CALLBACK) { WM_gizmo_group_refresh(C, gzgroup); @@ -1050,6 +1043,8 @@ wmGizmo *wm_gizmomap_highlight_get(wmGizmoMap *gzmap) void wm_gizmomap_modal_set( wmGizmoMap *gzmap, bContext *C, wmGizmo *gz, const wmEvent *event, bool enable) { + bool do_refresh = false; + if (enable) { BLI_assert(gzmap->gzmap_context.modal == NULL); wmWindow *win = CTX_wm_window(C); @@ -1068,6 +1063,9 @@ void wm_gizmomap_modal_set( } } + if (gzmap->gzmap_context.modal != gz) { + do_refresh = true; + } gz->state |= WM_GIZMO_STATE_MODAL; gzmap->gzmap_context.modal = gz; @@ -1092,7 +1090,6 @@ void wm_gizmomap_modal_set( gz->state &= ~WM_GIZMO_STATE_MODAL; MEM_SAFE_FREE(gz->interaction_data); } - return; } } else { @@ -1103,6 +1100,10 @@ void wm_gizmomap_modal_set( gz->state &= ~WM_GIZMO_STATE_MODAL; MEM_SAFE_FREE(gz->interaction_data); } + + if (gzmap->gzmap_context.modal != NULL) { + do_refresh = true; + } gzmap->gzmap_context.modal = NULL; if (C) { @@ -1124,6 +1125,12 @@ void wm_gizmomap_modal_set( gzmap->gzmap_context.event_xy[0] = INT_MAX; } + + if (do_refresh) { + const eWM_GizmoFlagMapDrawStep step = WM_gizmomap_drawstep_from_gizmo_group( + gz->parent_gzgroup); + gzmap->update_flag[step] |= GIZMOMAP_IS_REFRESH_CALLBACK; + } } wmGizmo *wm_gizmomap_modal_get(wmGizmoMap *gzmap) |