From 157d1205a42b07042d8abdb590034940b68f0b12 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 Oct 2010 14:16:27 +0000 Subject: added len_squared_v2v2, use instead of len_v3v3 for font handle tests, also fixed some warnings. --- source/blender/blenlib/intern/freetypefont.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/blenlib/intern/freetypefont.c') diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index 6d6abc88999..fc41839c303 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -252,15 +252,15 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf } // 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) && - (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; -- cgit v1.2.3