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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user