From: Severin Meyer <sev.ch@web.de>
Date: Thu, 5 Feb 2015 17:09:49 +0000 (+0100)
Subject: Make the weapon panel even more symmetrical and snappier
X-Git-Tag: xonotic-v0.8.1~106^2~11
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4fdfd2b482deae1f259cc776caa1f812c082c7ff;p=xonotic%2Fxonotic-data.pk3dir.git

Make the weapon panel even more symmetrical and snappier
---

diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc
index 9a54ceb92..99c6b106d 100644
--- a/qcsrc/client/hud.qc
+++ b/qcsrc/client/hud.qc
@@ -540,7 +540,7 @@ void HUD_Weapons(void)
 		// reduce rows and columns as needed
 		// NOTE: although weapons should aways look the same even if onlyowned is enabled,
 		// we enlarge them a bit when possible to better match the desired aspect ratio
-		if(rows > columns)
+		if(old_panel_size.y > old_panel_size.x)
 		{
 			columns = ceil(weapon_count / rows);
 			rows = ceil(weapon_count / columns);
@@ -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)
+		if(panel_pos.x > 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)
+		if(panel_pos.y > 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