]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve distribution of the icons and therefore use of the available space in the...
authorterencehill <piuntn@gmail.com>
Sun, 25 Jan 2015 18:25:32 +0000 (19:25 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 25 Jan 2015 18:26:51 +0000 (19:26 +0100)
qcsrc/client/hud.qc

index 2b067dee82e5d997e19a15c4861a898ba4167af8..e9ed89cd385f50a1bf2ff0d50dc1e5494172c951 100644 (file)
@@ -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)