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:
authorCampbell Barton <ideasman42@gmail.com>2021-11-04 10:10:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-11-04 10:10:07 +0300
commit36a6528723acc697e55cbc5d9c39416dd038649a (patch)
tree214921b37e8719689445d693882d36d6ce71cc89 /source/blender/windowmanager
parentd7f9f083d4bf922d7b8c93bd73a462b22d86fdeb (diff)
parent08c4f134d290be0229d4cc1cabcaa595efe93360 (diff)
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c25
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)