Fix Savannah bug #37017. * src/smooth/ftgrays.c (gray_render_cubic): Use a different set of checks when detecting super curvy splines to be split.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/ChangeLog b/ChangeLog
index 1d48e19..1415cea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-08-12 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ Fix Savannah bug #37017.
+
+ * src/smooth/ftgrays.c (gray_render_cubic): Use a different set of
+ checks when detecting super curvy splines to be split.
+
2012-08-05 Werner Lemberg <wl@gnu.org>
[autofit] Improve recognition of flat segments.
@@ -44,6 +51,12 @@
* src/type1/t1load.c (parse_encoding): Check cursor position after
call to T1_Skip_PS_Token.
+2012-07-12 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ Revert the last commit 45337b07.
+
+ * src/base/ftstroke.c (FT_Stroker_New): Revert the previous chenge.
+
2012-07-11 Alexei Podtelezhnikov <apodtele@gmail.com>
[ftstroke] Fix uninitialized return value.
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 926020a..27b85b8 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1091,11 +1091,11 @@ typedef ptrdiff_t FT_PtrDist;
if ( s > s_limit )
goto Split;
- /* If P1 or P2 is outside P0-P3, split the curve. */
- if ( dy * dy1 + dx * dx1 < 0 ||
- dy * dy2 + dx * dx2 < 0 ||
- dy * (arc[3].y - arc[1].y) + dx * (arc[3].x - arc[1].x) < 0 ||
- dy * (arc[3].y - arc[2].y) + dx * (arc[3].x - arc[2].x) < 0 )
+ /* Split super curvy segments where the off points are so far
+ from the chord that the angles P0-P1-P3 or P0-P2-P3 become
+ acute as detected by appropriate dot products. */
+ if ( dx1 * ( dx1 - dx ) + dy1 * ( dy1 - dy ) > 0 ||
+ dx2 * ( dx2 - dx ) + dy2 * ( dy2 - dy ) > 0 )
goto Split;
/* No reason to split. */