diff options
author | terkhen <terkhen@openttd.org> | 2011-01-04 22:56:56 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2011-01-04 22:56:56 +0000 |
commit | 0b27228d9a51de00b1a40fea43463c61b782fa15 (patch) | |
tree | 47a0337c72b8b54b0e6e7a16ad2a8bf56a9467b9 /src/smallmap_gui.cpp | |
parent | eab47d2227bad950dd04ab8498588d40f1f4f725 (diff) | |
download | openttd-0b27228d9a51de00b1a40fea43463c61b782fa15.tar.xz |
(svn r21729) -Fix (r21718, r21720): In some cases clicking on a industry/company legend entry would not work.
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r-- | src/smallmap_gui.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 08a3530d3..be3340aeb 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1291,7 +1291,7 @@ public: const NWidgetBase *wi = this->GetWidget<NWidgetBase>(SM_WIDGET_LEGEND); // Label panel uint line = (pt.y - wi->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_SMALL; uint columns = this->GetNumberColumnsLegend(wi->current_x); - uint number_of_rows = max(CeilDiv(_smallmap_industry_count, columns), this->min_number_of_fixed_rows); + uint number_of_rows = max(CeilDiv(max(_smallmap_company_count, _smallmap_industry_count), columns), this->min_number_of_fixed_rows); if (line >= number_of_rows) break; bool rtl = _current_text_dir == TD_RTL; @@ -1328,7 +1328,7 @@ public: const NWidgetBase *wi = this->GetWidget<NWidgetBase>(SM_WIDGET_LEGEND); uint line = (pt.y - wi->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_SMALL; uint columns = this->GetNumberColumnsLegend(wi->current_x); - uint number_of_rows = max(CeilDiv(_smallmap_company_count, columns), this->min_number_of_fixed_rows); + uint number_of_rows = max(CeilDiv(max(_smallmap_company_count, _smallmap_industry_count), columns), this->min_number_of_fixed_rows); if (line >= number_of_rows) break; bool rtl = _current_text_dir == TD_RTL; |