]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Base weapon panel snap threshold on screen size
authorSeverin Meyer <sev.ch@web.de>
Thu, 5 Feb 2015 19:09:07 +0000 (20:09 +0100)
committerSeverin Meyer <sev.ch@web.de>
Thu, 5 Feb 2015 19:09:07 +0000 (20:09 +0100)
qcsrc/client/hud.qc

index 99c6b106df8854ca245f2cbe991d564226858cb5..1816d07552d7ad2c801e6138ffe7fa3745f41a55 100644 (file)
@@ -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