MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetUnitNumberWidth

Function GetUnitNumberWidth

src/vehicle_gui.cpp:1746–1749  ·  view source on GitHub ↗

* Get width required for the formatted unit number display. * @param digits Number of digits required for unit number. * @return Required width in pixels. */

Source from the content-addressed store, hash-verified

1744 * @return Required width in pixels.
1745 */
1746static int GetUnitNumberWidth(int digits)
1747{
1748 return GetStringBoundingBox(GetString(STR_JUST_COMMA, GetParamMaxDigits(digits))).width;
1749}
1750
1751/**
1752 * Draw all the vehicle list items.

Callers 1

DrawVehicleListItemsMethod · 0.85

Calls 3

GetStringBoundingBoxFunction · 0.85
GetParamMaxDigitsFunction · 0.85
GetStringFunction · 0.70

Tested by

no test coverage detected