Fix [#21706] edit field in nodegroup which overlaps a node, edits the field of the...
authorMatt Ebb <matt@mke3.net>
Mon, 29 Mar 2010 07:15:12 +0000 (07:15 +0000)
committerMatt Ebb <matt@mke3.net>
Mon, 29 Mar 2010 07:15:12 +0000 (07:15 +0000)
source/blender/editors/space_node/node_draw.c

index 50f9d84ce71c54363ece5c5f48d6bd7cb4ffe03d..f4c9353ff923991677382bc484d244992f34adca 100644 (file)
@@ -394,9 +394,6 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode)
        rctf *rect= &gnode->totr;
        int counter;
        
-       /* init ui blocks for sub-nodetrees */
-       node_uiblocks_init(C, ngroup);
-       
        /* center them, is a bit of abuse of locx and locy though */
        for(node= ngroup->nodes.first; node; node= node->next) {
                node->locx+= gnode->locx;
@@ -1099,8 +1096,16 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
        if(snode->nodetree) {
                bNode *node;
                
+               /* init ui blocks for opened node group trees first 
+                * so they're in the correct depth stack order */
+               for(node= snode->nodetree->nodes.first; node; node= node->next) {
+                       if(node->flag & NODE_GROUP_EDIT)
+                               node_uiblocks_init(C, (bNodeTree *)node->id);
+               }
+
                node_uiblocks_init(C, snode->nodetree);
                
+               
                /* for now, we set drawing coordinates on each redraw */
                for(node= snode->nodetree->nodes.first; node; node= node->next) {
                        if(node->flag & NODE_GROUP_EDIT)