Fix transform nearest axis check
authorCampbell Barton <ideasman42@gmail.com>
Tue, 10 Apr 2018 14:13:32 +0000 (16:13 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 10 Apr 2018 14:14:29 +0000 (16:14 +0200)
Was mixing up global/local coords

source/blender/editors/transform/transform_constraints.c

index 5621eede54338084270690f8666b31d55f0bb296..08bd36fe95ca06c480f48cdd15dc05f3b04cebac 100644 (file)
@@ -979,7 +979,7 @@ static void setNearestAxis3d(TransInfo *t)
         * of two 2D points 30 pixels apart (that's the last factor in the formula) after
         * projecting them with ED_view3d_win_to_delta and then get the length of that vector.
         */
-       zfac = mul_project_m4_v3_zfac(t->persmat, t->center);
+       zfac = mul_project_m4_v3_zfac(t->persmat, t->center_global);
        zfac = len_v3(t->persinv[0]) * 2.0f / t->ar->winx * zfac * 30.0f;
 
        for (i = 0; i < 3; i++) {