]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix centerprint panel glitch when scoreboard bottom is far down
authorterencehill <piuntn@gmail.com>
Sat, 12 Dec 2020 12:41:22 +0000 (13:41 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 12 Dec 2020 12:41:22 +0000 (13:41 +0100)
qcsrc/client/hud/panel/centerprint.qc

index a0a5389e7e159e9e3f4ac52df534303ef47da9b0..105908094e5e0cc77ee41f0e0b8713b97b37a21d 100644 (file)
@@ -189,7 +189,7 @@ void HUD_CenterPrint()
 
        if ( HUD_Radar_Clickable() )
        {
-               if (hud_panel_radar_bottom >= 0.96 * vid_conheight)
+               if (hud_panel_radar_bottom >= vid_conheight)
                        return;
 
                panel_pos.x = 0.5 * (vid_conwidth - panel_size.x);
@@ -198,15 +198,16 @@ void HUD_CenterPrint()
        }
        else if(!autocvar__hud_configure && scoreboard_fade_alpha)
        {
-               // move the panel below the scoreboard
-               if (scoreboard_bottom >= 0.96 * vid_conheight)
-                       return;
                vector target_pos = vec2(0.5 * (vid_conwidth - panel_size.x), scoreboard_bottom);
                if(target_pos.y > panel_pos.y)
                {
                        panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
                        panel_size.y = min(panel_size.y, vid_conheight - scoreboard_bottom);
                }
+
+               // move the panel below the scoreboard
+               if (panel_pos.y >= vid_conheight)
+                       return;
        }
 
        if (autocvar_hud_panel_centerprint_dynamichud)