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
Notes: blender-bot 2023-02-14 08:01:58 +01:00
Referenced by issue #48028, GPU Compute in Cycles is broken on AMD stable drivers and Blender stable release
Referenced by issue #48013, UV Sculpt Brush Does not appear in UV window - but does show up in uv panels (t, n)
Referenced by issue #47998, Decimate Modifier; Bad geometry when following subsurf with planar decimation on a mesh with holes
1 changed files with 3 additions and 1 deletions

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];