From 6e5f6d0ce0bb00393b86db328ecef19bfe103108 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Tue, 29 Jan 2002 16:48:20 +0000 Subject: [PATCH] XFONT_GetAvgCharWidth: Always round up. --- graphics/x11drv/xfont.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphics/x11drv/xfont.c b/graphics/x11drv/xfont.c index 5b517a00018..5af32f57547 100644 --- a/graphics/x11drv/xfont.c +++ b/graphics/x11drv/xfont.c @@ -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; }