ref: 6a17172687cbcef081f2acb3e7257d2c9305c2aa
parent: d3284462c3f227a4bc396fa9f3b716e46d43f5c8
author: Alexei Podtelezhnikov <[email protected]>
date: Tue Mar 17 18:43:08 EDT 2015
Fix Savannah bug #44412 (part 2). * src/base/fttrigon.c (FT_Sin, FT_Cos, FT_Tan): Call `FT_Vector_Unit'.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-17 Alexei Podtelezhnikov <[email protected]>
+
+ Fix Savannah bug #44412 (part 2).
+
+ * src/base/fttrigon.c (FT_Sin, FT_Cos, FT_Tan): Call `FT_Vector_Unit'.
+
2015-03-11 Werner Lemberg <[email protected]>
[autofit] Add support for Arabic script.
--- a/src/base/fttrigon.c
+++ b/src/base/fttrigon.c
@@ -299,11 +299,9 @@
FT_Vector v;
- v.x = FT_TRIG_SCALE >> 8;
- v.y = 0;
- ft_trig_pseudo_rotate( &v, angle );
+ FT_Vector_Unit( &v, angle );
- return ( v.x + 0x80L ) >> 8;
+ return v.x;
}
@@ -312,7 +310,12 @@
FT_EXPORT_DEF( FT_Fixed )
FT_Sin( FT_Angle angle )
{
- return FT_Cos( FT_ANGLE_PI2 - angle );
+ FT_Vector v;
+
+
+ FT_Vector_Unit( &v, angle );
+
+ return v.y;
}
@@ -324,9 +327,7 @@
FT_Vector v;
- v.x = FT_TRIG_SCALE >> 8;
- v.y = 0;
- ft_trig_pseudo_rotate( &v, angle );
+ FT_Vector_Unit( &v, angle );
return FT_DivFix( v.y, v.x );
}