Cleanup: use normalize_v#_length
[blender.git] / source / blender / editors / transform / transform_constraints.c
index 13cc0c227788bbc5420b839ae911af03fe7c8b9a..d7b670b64764dcb2b88921218b565bd60b16529c 100644 (file)
@@ -187,9 +187,7 @@ static void viewAxisCorrectCenter(TransInfo *t, float t_con_center[3])
 
                if (l < min_dist) {
                        float diff[3];
-                       normalize_v3_v3(diff, t->viewinv[2]);
-                       mul_v3_fl(diff, min_dist - l);
-
+                       normalize_v3_v3_length(diff, t->viewinv[2], min_dist - l);
                        sub_v3_v3(t_con_center, diff);
                }
        }
@@ -225,9 +223,8 @@ static void axisProjection(TransInfo *t, const float axis[3], const float in[3],
                if (factor < 0.0f) factor *= -factor;
                else factor *= factor;
 
-               copy_v3_v3(out, axis);
-               normalize_v3(out);
-               mul_v3_fl(out, -factor);  /* -factor makes move down going backwards */
+               /* -factor makes move down going backwards */
+               normalize_v3_v3_length(out, axis, -factor);
        }
        else {
                float v[3], i1[3], i2[3];