* src/smooth/ftgrays.c (gray_move_to, gray_start_cell): Revert.
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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
diff --git a/ChangeLog b/ChangeLog
index f63c657..239874e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2016-09-05 Alexei Podtelezhnikov <apodtele@gmail.com>
+ * src/smooth/ftgrays.c (gray_move_to, gray_start_cell): Revert.
+
+2016-09-05 Alexei Podtelezhnikov <apodtele@gmail.com>
+
[smooth] Improve contour start.
* src/smooth/ftgrays.c (gray_move_to): Call `gray_set_cell' directly
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 698c105..f5cf7af 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -605,6 +605,29 @@ typedef ptrdiff_t FT_PtrDist;
}
+ /*************************************************************************/
+ /* */
+ /* Start a new contour at a given cell. */
+ /* */
+ static void
+ gray_start_cell( RAS_ARG_ TCoord ex,
+ TCoord ey )
+ {
+ if ( ex > ras.max_ex )
+ ex = ras.max_ex;
+
+ if ( ex < ras.min_ex )
+ ex = ras.min_ex - 1;
+
+ ras.area = 0;
+ ras.cover = 0;
+ ras.ex = ex - ras.min_ex;
+ ras.ey = ey - ras.min_ey;
+ ras.invalid = 0;
+
+ gray_set_cell( RAS_VAR_ ex, ey );
+ }
+
#ifndef FT_LONG64
/*************************************************************************/
@@ -1201,11 +1224,15 @@ typedef ptrdiff_t FT_PtrDist;
TPos x, y;
+ /* record current cell, if any */
+ if ( !ras.invalid )
+ gray_record_cell( RAS_VAR );
+
/* start to a new position */
x = UPSCALE( to->x );
y = UPSCALE( to->y );
- gray_set_cell( RAS_VAR_ TRUNC( x ), TRUNC( y ) );
+ gray_start_cell( RAS_VAR_ TRUNC( x ), TRUNC( y ) );
ras.x = x;
ras.y = y;