XFONT_GetAvgCharWidth: Always round up.
This commit is contained in:
parent
16d7d94f1f
commit
6e5f6d0ce0
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue