From: terencehill Date: Sun, 25 Jan 2015 18:25:32 +0000 (+0100) Subject: Improve distribution of the icons and therefore use of the available space in the... X-Git-Tag: xonotic-v0.8.1~129^2~6 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=8112b0a7a47e75b0a4e68b8a3ae6364ddda9de62 Improve distribution of the icons and therefore use of the available space in the simplest way --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 2b067dee8..e9ed89cd3 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -531,13 +531,8 @@ void HUD_Weapons(void) // reduce rows and columns as needed float columns_save = columns; - if(weapon_count <= rows) - { - rows = weapon_count; - columns = 1; - } - else - columns = ceil(weapon_count / rows); + 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)