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

Function GetStringListBoundingBox

src/gfx.cpp:935–942  ·  view source on GitHub ↗

* Get maximum dimension of a list of strings. * @param list List of strings, terminated by INVALID_STRING_ID. * @param fontsize Font size to use. * @return Dimension of highest and longest string within the list. */

Source from the content-addressed store, hash-verified

933 * @return Dimension of highest and longest string within the list.
934 */
935Dimension GetStringListBoundingBox(std::span<const StringID> list, FontSize fontsize)
936{
937 Dimension d{0, 0};
938 for (auto str : list) {
939 d = maxdim(d, GetStringBoundingBox(str, fontsize));
940 }
941 return d;
942}
943
944/**
945 * Draw single character horizontally centered around (x,y)

Callers 8

UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85

Calls 2

maxdimFunction · 0.85
GetStringBoundingBoxFunction · 0.85

Tested by

no test coverage detected