[autofit] Finish the thought. * src/autofit/afhints.c (af_direction_compute): make sure the long arm is never negative so that its `FT_ABS' is not necessary.
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
diff --git a/ChangeLog b/ChangeLog
index ff20967..3200560 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-03-21 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [autofit] Finish the thought.
+
+ * src/autofit/afhints.c (af_direction_compute): make sure the long arm
+ is never negative so that its `FT_ABS' is not necessary.
+
2015-04-01 Werner Lemberg <wl@gnu.org>
[autofit] Call dumper functions for tracing.
diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c
index 442cf6d..723e721 100644
--- a/src/autofit/afhints.c
+++ b/src/autofit/afhints.c
@@ -509,15 +509,15 @@
else
{
dir = AF_DIR_DOWN;
- ll = dy;
+ ll = -dy;
ss = dx;
}
}
- /* return no direction if arm lengths differ too much */
+ /* return no direction if arm lengths do not differ enough */
/* (value 14 is heuristic, corresponding to approx. 4.1 degrees) */
- ss *= 14;
- if ( FT_ABS( ll ) <= FT_ABS( ss ) )
+ /* the long arm is never negative */
+ if ( ll <= 14 * FT_ABS( ss ) )
dir = AF_DIR_NONE;
return dir;