[autofit] Minor code clean-up. * src/autofit/aflatin.c (af_latin_hints_compute_segments): Change some local variable names to better differentiate between values along a segment and values orthogonal to it.
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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
diff --git a/ChangeLog b/ChangeLog
index a8d1c64..c0c9796 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-02-27 Werner Lemberg <wl@gnu.org>
+
+ [autofit] Minor code clean-up.
+
+ * src/autofit/aflatin.c (af_latin_hints_compute_segments): Change
+ some local variable names to better differentiate between values
+ along a segment and values orthogonal to it.
+
2016-02-26 Werner Lemberg <wl@gnu.org>
[autofit] Improve BOUND action.
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 8da6ce1..4134739 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -1439,11 +1439,16 @@
AF_Point point = contour[0];
AF_Point last = point->prev;
int on_edge = 0;
- FT_Pos min_pos = 32000; /* minimum segment pos != min_coord */
- FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */
- FT_Pos min_on_pos = 32000;
- FT_Pos max_on_pos = -32000;
- FT_Bool passed;
+
+ /* we call values measured along a segment (point->v) */
+ /* `coordinates', and values orthogonal to it (point->u) */
+ /* `positions' */
+ FT_Pos min_pos = 32000;
+ FT_Pos max_pos = -32000;
+ FT_Pos min_on_coord = 32000;
+ FT_Pos max_on_coord = -32000;
+
+ FT_Bool passed;
if ( point == last ) /* skip singletons -- just in case */
@@ -1478,24 +1483,29 @@
if ( on_edge )
{
+ /* get minimum and maximum position */
u = point->u;
if ( u < min_pos )
min_pos = u;
if ( u > max_pos )
max_pos = u;
- /* get minimum and maximum coordinate of on points */
+ /* get minimum and maximum coordinate of `on' points */
if ( !( point->flags & AF_FLAG_CONTROL ) )
{
v = point->v;
- if ( v < min_on_pos )
- min_on_pos = v;
- if ( v > max_on_pos )
- max_on_pos = v;
+ if ( v < min_on_coord )
+ min_on_coord = v;
+ if ( v > max_on_coord )
+ max_on_coord = v;
}
if ( point->out_dir != segment_dir || point == last )
{
+ FT_Pos min_coord;
+ FT_Pos max_coord;
+
+
/* we are just leaving an edge; record a new segment! */
segment->last = point;
segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 );
@@ -1504,20 +1514,20 @@
/* is a control point, and the length of the on points */
/* inbetween doesn't exceed a heuristic limit */
if ( ( segment->first->flags | point->flags ) & AF_FLAG_CONTROL &&
- ( max_on_pos - min_on_pos ) < flat_threshold )
+ ( max_on_coord - min_on_coord ) < flat_threshold )
segment->flags |= AF_EDGE_ROUND;
/* compute segment size */
- min_pos = max_pos = point->v;
+ min_coord = max_coord = point->v;
v = segment->first->v;
- if ( v < min_pos )
- min_pos = v;
- if ( v > max_pos )
- max_pos = v;
+ if ( v < min_coord )
+ min_coord = v;
+ if ( v > max_coord )
+ max_coord = v;
- segment->min_coord = (FT_Short)min_pos;
- segment->max_coord = (FT_Short)max_pos;
+ segment->min_coord = (FT_Short)min_coord;
+ segment->max_coord = (FT_Short)max_coord;
segment->height = (FT_Short)( segment->max_coord -
segment->min_coord );
@@ -1555,11 +1565,11 @@
if ( point->flags & AF_FLAG_CONTROL )
{
- min_on_pos = 32000;
- max_on_pos = -32000;
+ min_on_coord = 32000;
+ max_on_coord = -32000;
}
else
- min_on_pos = max_on_pos = point->v;
+ min_on_coord = max_on_coord = point->v;
on_edge = 1;
}