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

Method getTextHeight

src/Interface/Text.cpp:301–316  ·  view source on GitHub ↗

* Returns the rendered text's height. Useful to check if wordwrap applies. * @param line Line to get the height, or -1 to get whole text height. * @return Height in pixels. */

Source from the content-addressed store, hash-verified

299 * @return Height in pixels.
300 */
301int Text::getTextHeight(int line) const
302{
303 if (line == -1)
304 {
305 int height = 0;
306 for (std::vector<int>::const_iterator i = _lineHeight.begin(); i != _lineHeight.end(); ++i)
307 {
308 height += *i;
309 }
310 return height;
311 }
312 else
313 {
314 return _lineHeight[line];
315 }
316}
317
318/**
319 * Returns the rendered text's width.

Callers 2

addLineMethod · 0.80
ArticleStateTextImageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected