[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.
This commit is contained in:
Alexei Podtelezhnikov 2015-04-01 22:57:43 -04:00
parent a2fa657a03
commit 886f4d0493
2 changed files with 11 additions and 4 deletions

View File

@ -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> 2015-04-01 Werner Lemberg <wl@gnu.org>
[autofit] Call dumper functions for tracing. [autofit] Call dumper functions for tracing.

View File

@ -509,15 +509,15 @@
else else
{ {
dir = AF_DIR_DOWN; dir = AF_DIR_DOWN;
ll = dy; ll = -dy;
ss = dx; 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) */ /* (value 14 is heuristic, corresponding to approx. 4.1 degrees) */
ss *= 14; /* the long arm is never negative */
if ( FT_ABS( ll ) <= FT_ABS( ss ) ) if ( ll <= 14 * FT_ABS( ss ) )
dir = AF_DIR_NONE; dir = AF_DIR_NONE;
return dir; return dir;