mirror of
https://gitlab.freedesktop.org/freetype/freetype.git
synced 2026-05-07 18:08:02 +02:00
fixed t1_tofixed() to handle floats of the form .001 and -.001 correctly.
This commit is contained in:
parent
5845e519ab
commit
0c99641a25
1 changed files with 13 additions and 8 deletions
|
|
@ -504,17 +504,22 @@
|
|||
if ( cur >= limit )
|
||||
return 0;
|
||||
|
||||
/* first of all, read the integer part */
|
||||
result = t1_toint( &cur, limit ) << 16;
|
||||
/* first of all, check the sign */
|
||||
if ( *cur == '-' )
|
||||
{
|
||||
sign = 1;
|
||||
cur++;
|
||||
}
|
||||
|
||||
/* then, read the integer part, if any */
|
||||
if ( *cur != '.' )
|
||||
result = t1_toint( &cur, limit ) << 16;
|
||||
else
|
||||
result = 0;
|
||||
|
||||
num = 0;
|
||||
divider = 1;
|
||||
|
||||
if ( result < 0 )
|
||||
{
|
||||
sign = 1;
|
||||
result = -result;
|
||||
}
|
||||
|
||||
if ( cur >= limit )
|
||||
goto Exit;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue