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

Method draw

src/Interface/TextList.cpp:872–897  ·  view source on GitHub ↗

* Draws the text list and all the text contained within. */

Source from the content-addressed store, hash-verified

870 * Draws the text list and all the text contained within.
871 */
872void TextList::draw()
873{
874 Surface::draw();
875 int y = 0;
876 if (!_rows.empty())
877 {
878 if (_scroll > 0 && _rows[_scroll] == _rows[_scroll-1])
879 y -= _font->getHeight() + _font->getSpacing();
880 for (size_t i = _rows[_scroll]; i < _texts.size() && i < _rows[_scroll] + _visibleRows; ++i)
881 {
882 for (std::vector<Text*>::iterator j = _texts[i].begin(); j < _texts[i].end(); ++j)
883 {
884 (*j)->setY(y);
885 (*j)->blit(this);
886 }
887 if (!_texts[i].empty())
888 {
889 y += _texts[i].front()->getHeight() + _font->getSpacing();
890 }
891 else
892 {
893 y += _font->getHeight() + _font->getSpacing();
894 }
895 }
896 }
897}
898
899/**
900 * Blits the text list and selector.

Callers

nothing calls this directly

Calls 5

getSpacingMethod · 0.80
emptyMethod · 0.45
getHeightMethod · 0.45
setYMethod · 0.45
blitMethod · 0.45

Tested by

no test coverage detected