Files
test/source
Jacques Lucke 0553f96bec Fix: Nodes: missing node tree centering
When a new node tree becomes active based on the context, the node editor was
not centered on the new tree. This can easily lead to the situation where there
is no node visible, and the user first has to search for the nodes.

The reason for this is unexpectedly special:
* `snode_set_context` calls `ED_node_tree_start` which adds the `NC_SCENE |
  ND_NODES` notifier.
* Typically, this would update the `View2D` of the region in
  `node_area_listener`.
* However, `snode_set_context` is called from
  `wm_event_do_refresh_wm_and_depsgraph` which happens after(!) the listeners
  run. Therefore, the node editor is redrawn before the listener is handled.
* During redraw, the stored view center is overridden. When it is later used in
  the listener, the value is lost already.

This patch solves this by updating the view center eagerly when opening changing
what node tree is visible, instead of trying to it lazily where the required
information might be lost already.

Pull Request: https://projects.blender.org/blender/blender/pulls/138389
2025-05-06 04:12:03 +02:00
..