From 9ea55c7c333e47345de2dff0e613e3e23dc8fdd3 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Sun, 12 Aug 2012 11:14:46 -0400 Subject: [PATCH] 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. --- ChangeLog | 13 +++++++++++++ src/smooth/ftgrays.c | 10 +++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d48e19b6..1415cea06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-08-12 Alexei Podtelezhnikov + + 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 [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 + + Revert the last commit 45337b07. + + * src/base/ftstroke.c (FT_Stroker_New): Revert the previous chenge. + 2012-07-11 Alexei Podtelezhnikov [ftstroke] Fix uninitialized return value. diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index 926020a2c..27b85b8bd 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. */