From: Severin Meyer Date: Thu, 5 Feb 2015 19:09:07 +0000 (+0100) Subject: Base weapon panel snap threshold on screen size X-Git-Tag: xonotic-v0.8.1~106^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c3227c69b79b3dcb4701d0ee2c9cd144f794c9ee;p=xonotic%2Fxonotic-data.pk3dir.git Base weapon panel snap threshold on screen size --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 99c6b106d..1816d0755 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -560,13 +560,13 @@ void HUD_Weapons(void) panel_size.y = rows * weapon_size.y; // center the resized panel, or snap it to the screen edge when close enough - if(panel_pos.x > 0.001) + 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; - if(panel_pos.y > 0.001) + 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