4440: Center timer in HUD (fixes #4438) r=heinrich5991 a=def-

![path45](https://user-images.githubusercontent.com/2335377/145616253-46f1f176-c6b8-4efa-9d2b-8e31f80b013c.png)
## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [x] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2021-12-11 21:56:36 +00:00 committed by GitHub
commit f0e13f7d90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,8 +127,7 @@ void CHud::RenderGameTimer()
str_time(Time * 100, TIME_DAYS, aBuf, sizeof(aBuf));
float FontSize = 10.0f;
float w;
w = TextRender()->TextWidth(0, 12,
float w = TextRender()->TextWidth(0, FontSize,
Time >= 3600 * 24 ? "00d 00:00:00" : Time >= 3600 ? "00:00:00" : "00:00",
-1, -1.0f);
// last 60 sec red, last 10 sec blink