Page MenuHome

Fix compositor backdrop gizmo refresh problem when toggling sidebar
AbandonedPublic

Authored by Philipp Oeser (lichtwerk) on May 28 2021, 12:56 PM.

Details

Summary

The boundingbox gizmo was not following the backdrop image, the main
regions gizmomap needs a refresh tag.

Easiest way for the node editor is to send a ND_SPACE_NODE_VIEW
notifier, main region node_region_listener listens to this and ensures
the gizmomap refresh. While this is a rather specialized call in a
rather general function, and we could also go through all area's regions
and refresh all of the gizmomaps, this patch keeps it local to the
nodeeditor to only fix the issue reported in T87591.

ref T87591

Diff Detail

Repository
rB Blender
Branch
T87591_b (branched from master)
Build Status
Buildable 14823
Build 14823: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.May 28 2021, 12:56 PM
Philipp Oeser (lichtwerk) created this revision.

I would not do such special handling in this function.

Suggested alternative fix:

diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index d7e16dd69f1..235a4211e17 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -651,6 +651,10 @@ static void node_main_region_init(wmWindowManager *wm, ARegion *region)
   lb = WM_dropboxmap_find("Node Editor", SPACE_NODE, RGN_TYPE_WINDOW);
 
   WM_event_add_dropbox_handler(&region->handlers, lb);
+
+  /* Refresh gizmos (mainly for the background image gizmo) on region size changes, on which the
+   * view moves. */
+  WM_gizmomap_tag_refresh(region->gizmo_map);
 }
 
 static void node_main_region_draw(const bContext *C, ARegion *region)

That is, refresh the gizmos when the region size changes (which causes the region to be re-initialized).

I would not do such special handling in this function.

Suggested alternative fix:

diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index d7e16dd69f1..235a4211e17 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -651,6 +651,10 @@ static void node_main_region_init(wmWindowManager *wm, ARegion *region)
   lb = WM_dropboxmap_find("Node Editor", SPACE_NODE, RGN_TYPE_WINDOW);
 
   WM_event_add_dropbox_handler(&region->handlers, lb);
+
+  /* Refresh gizmos (mainly for the background image gizmo) on region size changes, on which the
+   * view moves. */
+  WM_gizmomap_tag_refresh(region->gizmo_map);
 }
 
 static void node_main_region_draw(const bContext *C, ARegion *region)

That is, refresh the gizmos when the region size changes (which causes the region to be re-initialized).

Yep, that sounds good/better to me indeed, thx checking!