Fix T39479: Transform mouse constraint fails in some situations.
authorBastien Montagne <montagne29@wanadoo.fr>
Sun, 6 Apr 2014 09:11:56 +0000 (11:11 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Sun, 6 Apr 2014 09:11:56 +0000 (11:11 +0200)
Some more float precision issue...

source/blender/editors/transform/transform_constraints.c

index 9cc65c20e66f41705aed3cec117dc3ff3513169f..4cc8833ba1efb0a6a87559766dc1977d12e1744f 100644 (file)
@@ -969,13 +969,13 @@ static void setNearestAxis3d(TransInfo *t)
                sub_v2_v2v2(axis, axis_2d, t->center2d);
                axis[2] = 0.0f;
 
-               if (normalize_v3(axis) != 0.0f) {
+               if (normalize_v3(axis) > 1e-3f) {
                        project_v3_v3v3(proj, mvec, axis);
                        sub_v3_v3v3(axis, mvec, proj);
                        len[i] = normalize_v3(axis);
                }
                else {
-                       len[i] = 10000000000.0f;
+                       len[i] = 1e10f;
                }
        }