MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getTextWidth

Method getTextWidth

src/Interface/Text.cpp:323–341  ·  view source on GitHub ↗

* Returns the rendered text's width. * @param line Line to get the width, or -1 to get whole text width. * @return Width in pixels. */

Source from the content-addressed store, hash-verified

321 * @return Width in pixels.
322 */
323int Text::getTextWidth(int line) const
324{
325 if (line == -1)
326 {
327 int width = 0;
328 for (std::vector<int>::const_iterator i = _lineWidth.begin(); i != _lineWidth.end(); ++i)
329 {
330 if (*i > width)
331 {
332 width = *i;
333 }
334 }
335 return width;
336 }
337 else
338 {
339 return _lineWidth[line];
340 }
341}
342
343/**
344 * Takes care of any text post-processing like calculating

Callers 6

ListGamesStateMethod · 0.80
addLineMethod · 0.80
OptionsAdvancedStateMethod · 0.80
OptionsModsStateMethod · 0.80
addRowMethod · 0.80
drawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected