XFONT_GetAvgCharWidth: Always round up.

This commit is contained in:
Uwe Bonnes 2002-01-29 16:48:20 +00:00 committed by Alexandre Julliard
parent 16d7d94f1f
commit 6e5f6d0ce0
1 changed files with 2 additions and 1 deletions

View File

@ -1099,12 +1099,13 @@ static INT XFONT_GetAvgCharWidth( LPIFONTINFO16 pFI, const XFontStruct* x_fs,
chars++;
}
}
if (chars) avg = (width + (chars>>1))/ chars;
if (chars) avg = (width + (chars-1))/ chars; /* always round up*/
else avg = 0; /* No characters exist at all */
}
else /* uniform width */
avg = x_fs->min_bounds.width;
TRACE(" retuning %d\n",avg);
return avg;
}