From 73779b91155c24aa9df8612c9d3d83da47ce70bb Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 2 Feb 2015 17:45:38 +0100 Subject: [PATCH] Weapons panel: better way to enlarge weapon_size to match desired aspect --- qcsrc/client/hud.qc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 7517775da..9bc90d49f 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -535,13 +535,14 @@ void HUD_Weapons(void) weapon_size_y = old_panel_size_y / rows; // reduce rows and columns as needed - float columns_save = columns; columns = ceil(weapon_count / rows); rows = ceil(weapon_count / columns); - // enlarge weapon_size to match desired aspect ratio in order to capitalize on panel space - if(columns < columns_save) - weapon_size_x = min(old_panel_size_x / columns, aspect * weapon_size_y); + // NOTE: although weapons should aways look the same even if onlyowned is disabled, + // we enlarge them a bit when possible to better match the desired aspect ratio + // as they look much better + weapon_size_x = min(old_panel_size_x / columns, aspect * weapon_size_y); + weapon_size_y = min(old_panel_size_y / rows, weapon_size_x / aspect); // reduce size of the panel panel_size_x = columns * weapon_size_x; -- 2.39.2