From 6d88270f444069a01abeacdaa895d84fb37d83ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Sat, 10 Jan 2026 11:28:42 +0000 Subject: [PATCH] fix: use the correct size and alignment of the divider in spectator mode --- cl_dll/hud/spectator_gui.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/cl_dll/hud/spectator_gui.cpp b/cl_dll/hud/spectator_gui.cpp index fd45e53f..ed516b35 100644 --- a/cl_dll/hud/spectator_gui.cpp +++ b/cl_dll/hud/spectator_gui.cpp @@ -142,7 +142,23 @@ int CHudSpectatorGui::Draw( float flTime ) FillRGBABlend(0, ScreenHeight - INT_YPOS(2), ScreenWidth, INT_YPOS(2), 0, 0, 0, 153); // divider - FillRGBABlend( INT_XPOS(12.5), INT_YPOS(2) * 0.25, 1, INT_YPOS(2) * 0.5, r, g, b, 255 ); + { + int divX = INT_XPOS(12.5); + int divTop = INT_YPOS(2) * 0.25; + int divBottom = INT_YPOS(2) * 0.5 + gHUD.GetCharHeight(); + int divH = divBottom - divTop; + if (divH < gHUD.GetCharHeight()) divH = gHUD.GetCharHeight(); + + int pad = (gHUD.GetCharHeight() * 2) / 3; + if (pad < 1) pad = 1; + + int drawTop = divTop - pad; + if (drawTop < 0) drawTop = 0; + int drawH = divH + pad * 2; + if (drawTop + drawH > ScreenHeight) drawH = ScreenHeight - drawTop; + + FillRGBABlend(divX, drawTop, 1, drawH, r, g, b, 255); + } { // mapname. extradata DrawUtils::DrawHudString( INT_XPOS(12.5) + 10, INT_YPOS(2) * 0.25, ScreenWidth, label.m_szMap, r, g, b );