From c3227c69b79b3dcb4701d0ee2c9cd144f794c9ee Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 5 Feb 2015 20:09:07 +0100 Subject: [PATCH] Base weapon panel snap threshold on screen size --- qcsrc/client/hud.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.2