[Bug]: vehicle number and group name are a bit too close
SamuXarick opened this issue · 3 comments
This seems to only happen on large numbers as the UI was designed in small numbers in mind ?
For a small amount of ships it looks good:
What would be the desired approach to fix this ?
Apply more spacing to it ?
Lower the font so that it fits still on higher numbers ?
Does applying more space to it directly run the risk of messing the rest of the UI on spacing as well ?
I believe I've narrowed down a good place to start to line 1706 in vehicle_gui.cpp:
int text_offset = std::max<int>(profit.width, GetDigitWidth() * this->unitnumber_digits) + WidgetDimensions::scaled.hsep_normal;
It looks like GetDigitWidth takes the width of the standard font size, not the unit number font. So it gets closer as it gets longer and starts getting close to/overlapping the group name by 4 digits (It supports up to 5). Probably just need to be changed to GetDigitWidth() * 1.5 * this->unitnumber_digits
or GetDigitWidth() * 2 * this->unitnumber_digits
to have it offset without overlap.
Not available to test this at the moment, but that's about as simple as it gets is someone wants to give it a try.
The "unit number font" is the standard font, the issue is it's just counting digits, and ignoring the comma.