=bmesh= merge from trunk at r36529
[blender.git] / source / blender / editors / space_view3d / view3d_snap.c
index 61118805a4e119ab8d8c40c62548e2a9bd1df6a4..14e46a2c65bd73d31b4c691e6a8cebb57272303c 100644 (file)
@@ -839,9 +839,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
                        VECCOPY(curs, centroid);
                }
                else {
-                       curs[0]= (min[0]+max[0])/2;
-                       curs[1]= (min[1]+max[1])/2;
-                       curs[2]= (min[2]+max[2])/2;
+                       mid_v3_v3v3(curs, min, max);
                }
                MEM_freeN(transvmain);
                transvmain= NULL;
@@ -879,9 +877,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
                                VECCOPY(curs, centroid);
                        }
                        else {
-                               curs[0]= (min[0]+max[0])/2;
-                               curs[1]= (min[1]+max[1])/2;
-                               curs[2]= (min[2]+max[2])/2;
+                               mid_v3_v3v3(curs, min, max);
                        }
                }
        }
@@ -1022,4 +1018,3 @@ int minmax_verts(Object *obedit, float *min, float *max)
        
        return 1;
 }
-