From b45e721faae5bef79dc8317279220252c75cbb34 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 3 Jan 2016 15:22:40 +0000 Subject: [PATCH] Fix group info when GUI/font is scaled. --- src/group_gui.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/group_gui.cpp b/src/group_gui.cpp index da3fff82f0..9c1a6c0116 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -193,7 +193,7 @@ private: uint ComputeGroupInfoSize() { this->column_size[VGC_NAME] = maxdim(GetStringBoundingBox(STR_GROUP_DEFAULT_TRAINS + this->vli.vtype), GetStringBoundingBox(STR_GROUP_ALL_TRAINS + this->vli.vtype)); - this->column_size[VGC_NAME].width = max(170u, this->column_size[VGC_NAME].width); + this->column_size[VGC_NAME].width = max((170u * FONT_HEIGHT_NORMAL) / 10u, this->column_size[VGC_NAME].width); this->tiny_step_height = this->column_size[VGC_NAME].height; this->column_size[VGC_PROTECT] = GetSpriteSize(SPR_GROUP_REPLACE_PROTECT); @@ -373,7 +373,7 @@ public: max_icon_height = max(max_icon_height, GetSpriteSize(this->GetWidget(WID_GL_REPLACE_PROTECTION)->widget_data).height); /* ... minus the height of the group info ... */ - max_icon_height += 37; + max_icon_height += (FONT_HEIGHT_NORMAL * 3) + 7; /* Get a multiple of tiny_step_height of that amount */ size->height = Ceil(size->height - max_icon_height, tiny_step_height); @@ -407,6 +407,11 @@ public: *size = maxdim(*size, d); break; } + + case WID_GL_INFO: { + size->height = (FONT_HEIGHT_NORMAL * 3) + 7; + break; + } } }