From: terencehill Date: Mon, 9 Feb 2015 11:28:39 +0000 (+0100) Subject: Center onlyowned panel if the original panel snaps to a whole screen side X-Git-Tag: xonotic-v0.8.1~106^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bdc3e3b86271ee599bcf3d1f4deb59511709a7d7;p=xonotic%2Fxonotic-data.pk3dir.git Center onlyowned panel if the original panel snaps to a whole screen side --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index c799ad550..f02139151 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -586,16 +586,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;