]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Center onlyowned weapon panel if the panel bounds reach across the whole screen
authorSeverin Meyer <sev.ch@web.de>
Mon, 9 Feb 2015 19:16:29 +0000 (20:16 +0100)
committerSeverin Meyer <sev.ch@web.de>
Mon, 9 Feb 2015 19:16:29 +0000 (20:16 +0100)
qcsrc/client/hud.qc

index 86dfadbaf20b6c6c3d53e782bee9544f65d75040..105cce5f2ea850f6cc95fbc25283b304e726f325 100644 (file)
@@ -563,16 +563,24 @@ void HUD_Weapons(void)
 
                // center the resized panel, or snap it to the screen edge when close enough
                if(panel_pos.x > vid_conwidth * 0.001)
+               {
                        if(panel_pos.x + old_panel_size.x > vid_conwidth * 0.999)
                                panel_pos.x += old_panel_size.x - panel_size.x;
                        else
                                panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
+               }
+               else if(old_panel_size.x > vid_conwidth * 0.999)
+                       panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
 
                if(panel_pos.y > vid_conheight * 0.001)
+               {
                        if(panel_pos.y + old_panel_size.y > vid_conheight * 0.999)
                                panel_pos.y += old_panel_size.y - panel_size.y;
                        else
                                panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
+               }
+               else if(old_panel_size.y > vid_conheight * 0.999)
+                       panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
        }
        else
                weapon_count = WEP_COUNT;