diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-03-29 23:15:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-03-29 23:15:33 +0300 |
commit | 29bb10ee964a23df393442ceb98ddaf747c8c5f1 (patch) | |
tree | cc28cf1d49cfbe5e0694f10a400bded18244d7ec | |
parent | 37e1e2695cc3e491aea9e4364ef2becdec416647 (diff) |
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.
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 8c97dfd2e17..eb6308d1c41 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -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]; |