Fix: node frame boundaries incorrect when opening files

Make sure that frame dimensions are updated in the correct order.
This commit is contained in:
Jacques Lucke 2022-11-21 11:22:44 +01:00
parent 24bd2d0bea
commit 3648fd9917
Notes: blender-bot 2023-02-14 08:47:25 +01:00
Referenced by issue #100627, Regression: Nodes UI: Node Frame updating after draw causes artifacts
1 changed files with 3 additions and 3 deletions

View File

@ -2712,7 +2712,6 @@ static void node_update_nodetree(const bContext &C,
count_multi_input_socket_links(ntree, *snode);
/* Update nodes front to back, so children sizes get updated before parents. */
for (const int i : nodes.index_range()) {
bNode &node = *nodes[i];
uiBlock &block = *blocks[i];
@ -2734,8 +2733,9 @@ static void node_update_nodetree(const bContext &C,
}
}
/* Now calculate the size of frame nodes, which can depend on the size of other nodes. */
for (const int i : nodes.index_range()) {
/* Now calculate the size of frame nodes, which can depend on the size of other nodes.
* Update nodes in reverse, so children sizes get updated before parents. */
for (int i = nodes.size() - 1; i >= 0; i--) {
if (nodes[i]->type == NODE_FRAME) {
frame_node_prepare_for_draw(*nodes[i], nodes);
}