Alway round up in XFONT_GetAvgCharWidth

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Thu Jan 24 15:27:55 CST 2002


graphics/x11drv/xfonts.c: XFONT_GetAvgCharWidth
	Always round up

This makes the dialog in enc99 setup come in some sensible size.
(Thanks to Alexandre for being so persistant :-)

Bye

--
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Free Software: If you contribute nothing, expect nothing
--

Index: wine/graphics/x11drv/xfont.c
===================================================================
RCS file: /home/wine/wine/graphics/x11drv/xfont.c,v
retrieving revision 1.89
diff -u -r1.89 xfont.c
--- wine/graphics/x11drv/xfont.c	6 Nov 2001 00:46:36 -0000	1.89
+++ wine/graphics/x11drv/xfont.c	24 Jan 2002 21:24:55 -0000
@@ -1094,12 +1094,13 @@
 		    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;
 }
 





More information about the wine-patches mailing list