Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-04-11 11:47:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-11 11:47:09 +0400
commit9ae0523921fa4baeb37bcdd36f208da952f4337f (patch)
treec83e79ef9a40f9018baa375ff1c5911998c4448a /source/blender/blenlib/intern/math_vector.c
parentff6867a768674353fb8bbd5c6e7b418a9fa1ad80 (diff)
fix [#30897] UVEditor: Snap Cursor to Selected
was writing the 3rd component of a 2D vector.
Diffstat (limited to 'source/blender/blenlib/intern/math_vector.c')
-rw-r--r--source/blender/blenlib/intern/math_vector.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 65600a31042..4b3ba7244d4 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -109,6 +109,12 @@ void mid_v3_v3v3(float v[3], const float v1[3], const float v2[3])
v[2] = 0.5f * (v1[2] + v2[2]);
}
+void mid_v2_v2v2(float v[2], const float v1[2], const float v2[2])
+{
+ v[0] = 0.5f * (v1[0] + v2[0]);
+ v[1] = 0.5f * (v1[1] + v2[1]);
+}
+
/********************************** Angles ***********************************/
/* Return the angle in radians between vecs 1-2 and 2-3 in radians