avoid floating point exceptions in snapObjects(), was attempting to scale up FLT_MAX.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 8 Mar 2013 15:10:57 +0000 (15:10 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 8 Mar 2013 15:10:57 +0000 (15:10 +0000)
source/blender/editors/transform/transform_snap.c

index aeeb3b1..559a9ef 100644 (file)
@@ -1550,7 +1550,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c
                        int *r_dist, float r_loc[3], float r_no[3], SnapMode mode)
 {
        Base *base;
-       float depth = FLT_MAX;
+       float depth = (FLT_MAX / 2.0f);  /* use half of flt-max so we can scale up without an exception */
        int retval = 0;
        float ray_start[3], ray_normal[3];