fix remaining crash from [#27035] 3 problems: crash and enum "REGION" not found in ('VERTS')

This commit is contained in:
2011-05-18 09:58:17 +00:00
parent 0454c817ef
commit 304ce06a5a
2 changed files with 9 additions and 4 deletions

View File

@@ -5323,7 +5323,7 @@ void createTransData(bContext *C, TransInfo *t)
sort_trans_data_dist(t);
}
if (t->ar->regiontype == RGN_TYPE_WINDOW)
if ((t->spacetype == SPACE_VIEW3D) && (t->ar->regiontype == RGN_TYPE_WINDOW))
{
View3D *v3d = t->view;
RegionView3D *rv3d = CTX_wm_region_view3d(C);

View File

@@ -1039,9 +1039,14 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
}
else
{
// XXX for now, get View2D from the active region
t->view = &ar->v2d;
// XXX for now, the center point is the midpoint of the data
if(ar) {
// XXX for now, get View2D from the active region
t->view = &ar->v2d;
// XXX for now, the center point is the midpoint of the data
}
else {
t->view= NULL;
}
t->around = V3D_CENTER;
}