added len_squared_v2v2, use instead of len_v3v3 for font handle tests, also fixed...
[blender-staging.git] / source / blender / blenlib / intern / freetypefont.c
index 6d6abc889993f0f46a71658e860d2fda76d3aa1f..fc41839c303396f3c7e551df2c9741790675b8a4 100644 (file)
@@ -252,15 +252,15 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
                                        }
 
                                        // get the handles that are aligned, tricky...
                                        }
 
                                        // get the handles that are aligned, tricky...
-                                       // DistVL2Dfl, check if the three beztriple points are on one line
-                                       // VecLenf, see if there's a distance between the three points
-                                       // VecLenf again, to check the angle between the handles 
+                                       // dist_to_line_v2, check if the three beztriple points are on one line
+                                       // len_squared_v2v2, see if there's a distance between the three points
+                                       // len_squared_v2v2 again, to check the angle between the handles 
                                        // finally, check if one of them is a vector handle 
                                        if((dist_to_line_v2(bezt->vec[0],bezt->vec[1],bezt->vec[2]) < 0.001) &&
                                        // finally, check if one of them is a vector handle 
                                        if((dist_to_line_v2(bezt->vec[0],bezt->vec[1],bezt->vec[2]) < 0.001) &&
-                                               (len_v3v3(bezt->vec[0], bezt->vec[1]) > 0.0001) &&
-                                               (len_v3v3(bezt->vec[1], bezt->vec[2]) > 0.0001) &&
-                                               (len_v3v3(bezt->vec[0], bezt->vec[2]) > 0.0002) &&
-                                               (len_v3v3(bezt->vec[0], bezt->vec[2]) > MAX2(len_v3v3(bezt->vec[0], bezt->vec[1]), len_v3v3(bezt->vec[1], bezt->vec[2]))) &&
+                                               (len_squared_v2v2(bezt->vec[0], bezt->vec[1]) > 0.0001*0.0001) &&
+                                               (len_squared_v2v2(bezt->vec[1], bezt->vec[2]) > 0.0001*0.0001) &&
+                                               (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > 0.0002*0.0001) &&
+                                               (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > MAX2(len_squared_v2v2(bezt->vec[0], bezt->vec[1]), len_squared_v2v2(bezt->vec[1], bezt->vec[2]))) &&
                                                bezt->h1 != HD_VECT && bezt->h2 != HD_VECT)
                                        {
                                                bezt->h1= bezt->h2= HD_ALIGN;
                                                bezt->h1 != HD_VECT && bezt->h2 != HD_VECT)
                                        {
                                                bezt->h1= bezt->h2= HD_ALIGN;