fix transform code using a node space as an image space, accessing unallocated memory.
[blender.git] / source / blender / editors / transform / transform_generics.c
index cf169dd587e47e8c54ffdb4f51706e11b2910246..8c7a39e5dff3ad986b3080a6eb16fd68b4e5a410 100644 (file)
@@ -1018,12 +1018,18 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
                        }
                }
        }
-       else if(t->spacetype==SPACE_IMAGE || t->spacetype==SPACE_NODE)
+       else if(t->spacetype==SPACE_IMAGE)
        {
                SpaceImage *sima = sa->spacedata.first;
-               // XXX for now, get View2D  from the active region
+               // XXX for now, get View2D from the active region
                t->view = &ar->v2d;
-               t->around = (sima ? sima->around : 0);
+               t->around = sima->around;
+       }
+       else if(t->spacetype==SPACE_NODE)
+       {
+               // XXX for now, get View2D from the active region
+               t->view = &ar->v2d;
+               t->around = V3D_CENTER;
        }
        else if(t->spacetype==SPACE_IPO) 
        {