1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 17:19:09 +00:00

Change: Don't measure group name widths in company livery window.

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.
This commit is contained in:
2025-05-21 13:58:00 +01:00
parent 9f190aa534
commit fb86fdbc0b

View File

@@ -750,13 +750,6 @@ public:
d = maxdim(d, GetStringBoundingBox(STR_LIVERY_DEFAULT + scheme)); 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); size.width = std::max(size.width, 5 + d.width + padding.width);
break; break;
} }