Fix transform center2d for 2d views

While this didn't show up as a bug, the center2d was being calculated with a zero aspect,
causing TransInfo.center2d to be NAN.
This commit is contained in:
Campbell Barton
2016-03-30 07:15:33 +11:00
parent 37e1e2695c
commit 29bb10ee96

View File

@@ -1421,8 +1421,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
#endif
setTransformViewMatrices(t);
setTransformViewAspect(t, t->aspect);
setTransformViewMatrices(t);
initNumInput(&t->num);
}
@@ -1582,6 +1582,8 @@ void restoreTransObjects(TransInfo *t)
void calculateCenter2D(TransInfo *t)
{
BLI_assert(!is_zero_v3(t->aspect));
if (t->flag & (T_EDIT | T_POSE)) {
Object *ob = t->obedit ? t->obedit : t->poseobj;
float vec[3];