Fix: Scale smallmap legend 'blob' to fit text.

(cherry picked from commit 5434d63f91)
This commit is contained in:
Peter Nelson
2021-04-22 21:47:18 +01:00
committed by Jonathan G Rennison
parent 6e272df9b0
commit ce69d6e216
2 changed files with 14 additions and 9 deletions

View File

@@ -88,7 +88,6 @@ protected:
static bool show_towns; ///< Display town names in the smallmap.
static int map_height_limit; ///< Currently used/cached map height limit.
static const uint LEGEND_BLOB_WIDTH = 8; ///< Width of the coloured blob in front of a line text in the #WID_SM_LEGEND widget.
static const uint INDUSTRY_MIN_NUMBER_OF_COLUMNS = 2; ///< Minimal number of columns in the #WID_SM_LEGEND widget for the #SMT_INDUSTRY legend.
static const uint FORCE_REFRESH_PERIOD = 930; ///< map is redrawn after that many milliseconds (default).
static const uint FORCE_REFRESH_PERIOD_VEH = 240; ///< map is redrawn after that many milliseconds (modes with vehicles).
@@ -98,6 +97,7 @@ protected:
uint min_number_of_columns; ///< Minimal number of columns in legends.
uint min_number_of_fixed_rows; ///< Minimal number of rows in the legends for the fixed layouts only (all except #SMT_INDUSTRY).
uint column_width; ///< Width of a column in the #WID_SM_LEGEND widget.
uint legend_width; ///< Width of legend 'blob'.
int32 scroll_x; ///< Horizontal world coordinate of the base tile left of the top-left corner of the smallmap display.
int32 scroll_y; ///< Vertical world coordinate of the base tile left of the top-left corner of the smallmap display.