From 1064309ecf81a42a76ba655fd30bf5085cadb259 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 22 May 2025 22:57:50 +0100 Subject: [PATCH] Change: Don't measure group name widths in company livery window. (#14291) Measuring the name width did not also take account of indentation levels so didn't prevent cropping, and the window can be resized anyway. This avoids a potential bottleneck due to layouting group names if there are a lot of groups present. --- src/company_gui.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 80f3a72c8b..7253670ac5 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -750,13 +750,6 @@ public: d = maxdim(d, GetStringBoundingBox(STR_LIVERY_DEFAULT + scheme)); } - /* And group names */ - for (const Group *g : Group::Iterate()) { - if (g->owner == this->window_number) { - d = maxdim(d, GetStringBoundingBox(GetString(STR_GROUP_NAME, g->index))); - } - } - size.width = std::max(size.width, 5 + d.width + padding.width); break; }