Fix: Show node editor dot grid when there is no node tree

This commit is contained in:
Hans Goudey 2021-10-26 13:03:09 -05:00
parent 0bfae1b120
commit c7b27f45ae
1 changed files with 3 additions and 3 deletions

View File

@ -2272,6 +2272,9 @@ void node_draw_space(const bContext *C, ARegion *region)
/* Nodes. */
snode_set_context(C);
const int grid_levels = UI_GetThemeValueType(TH_NODE_GRID_LEVELS, SPACE_NODE);
UI_view2d_dot_grid_draw(v2d, TH_GRID, NODE_GRID_STEP_SIZE, grid_levels);
/* Draw parent node trees. */
if (snode->treepath.last) {
bNodeTreePath *path = (bNodeTreePath *)snode->treepath.last;
@ -2294,9 +2297,6 @@ void node_draw_space(const bContext *C, ARegion *region)
copy_v2_v2(snode->edittree->view_center, center);
}
const int grid_levels = UI_GetThemeValueType(TH_NODE_GRID_LEVELS, SPACE_NODE);
UI_view2d_dot_grid_draw(v2d, TH_GRID, NODE_GRID_STEP_SIZE, grid_levels);
/* Top-level edit tree. */
bNodeTree *ntree = path->nodetree;
if (ntree) {