* Get the number of rows in the legend from the number of columns. Those * are at least min_number_of_fixed_rows and possibly more if there are so * many cargoes, industry types or companies that they won't fit in the * available space. * @param columns Number of columns in the legend. * @return Number of rows needed for everything to fit in. */
| 773 | * @return Number of rows needed for everything to fit in. |
| 774 | */ |
| 775 | uint GetNumberRowsLegend(uint columns) const |
| 776 | { |
| 777 | /* Reserve one column for link colours */ |
| 778 | uint num_rows_linkstats = CeilDiv(_smallmap_cargo_count, columns - 1); |
| 779 | uint num_rows_others = CeilDiv(std::max(_smallmap_industry_count, _smallmap_company_count), columns); |
| 780 | return std::max({this->min_number_of_fixed_rows, num_rows_linkstats, num_rows_others}); |
| 781 | } |
| 782 | |
| 783 | /** |
| 784 | * Select and toggle a legend item. When CTRL is pressed, disable all other |
no test coverage detected