Commit 01152db10adecd1a0cf6f583950c1e17fc5ccdb7

David Turner 2005-05-21T10:42:32

* src/base/ftsynth.c (FT_GlyphSlot_Embolden): fixing a bug that produced unpleasant artefacts when trying to embolden very sharp corners.

diff --git a/ChangeLog b/ChangeLog
index 5d491c1..9f3fb46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-05-21  David Turner  <david@freetype.org>
+
+    * src/base/ftsynth.c (FT_GlyphSlot_Embolden): fixing a bug that produced
+    unpleasant artefacts when trying to embolden very sharp corners.
+
 2005-05-20  Werner Lemberg  <wl@gnu.org>
 
 	* docs/CHANGES: Updated.
diff --git a/src/base/ftsynth.c b/src/base/ftsynth.c
index e030b35..5969af9 100644
--- a/src/base/ftsynth.c
+++ b/src/base/ftsynth.c
@@ -134,17 +134,16 @@
         angle_diff = FT_Angle_Diff( angle_in, angle_out );
         scale      = FT_Cos( angle_diff/2 );
 
-        if ( scale < 0x400L && scale > -0x400L )
+        if ( scale < 0x4000L && scale > -0x4000L )
         {
-          if ( scale >= 0 )
-            scale = 0x400L;
-          else
-            scale = -0x400L;
+          in.x = in.y = 0;
         }
+        else
+        {
+          d = FT_DivFix( distance, scale );
 
-        d = FT_DivFix( distance, scale );
-
-        FT_Vector_From_Polar( &in, d, angle_in + angle_diff/2 - rotate );
+          FT_Vector_From_Polar( &in, d, angle_in + angle_diff/2 - rotate );
+        }
 
         outline->points[n].x = v_cur.x + distance + in.x;
         outline->points[n].y = v_cur.y + distance + in.y;