From 9055d674eb7e32b6d399d5cb48718ca87f6091d9 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 22 Jan 2017 17:10:25 +0000 Subject: [PATCH] fix possible text truncation issues (eg: pings on the scoreboard). reported by kt. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5045 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/sbar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/client/sbar.c b/engine/client/sbar.c index d27fb22c1..eb29a4ab2 100644 --- a/engine/client/sbar.c +++ b/engine/client/sbar.c @@ -216,7 +216,8 @@ void Draw_FunStringWidth(float x, float y, const void *str, int width, int right int fw = 0; unsigned int codeflags, codepoint; - width = (width*vid.rotpixelwidth)/vid.width; + //be generous and round up, to avoid too many issues with truncations + width = ceil((width*(float)vid.rotpixelwidth)/vid.width); codeflags = (highlight&1)?CON_ALTMASK:CON_WHITEMASK; if (highlight&2)