* Blits the text list and selector. * @param surface Pointer to surface to blit onto. */
| 901 | * @param surface Pointer to surface to blit onto. |
| 902 | */ |
| 903 | void TextList::blit(Surface *surface) |
| 904 | { |
| 905 | if (_visible && !_hidden) |
| 906 | { |
| 907 | _selector->blit(surface); |
| 908 | } |
| 909 | Surface::blit(surface); |
| 910 | if (_visible && !_hidden) |
| 911 | { |
| 912 | if (_arrowPos != -1 && !_rows.empty()) |
| 913 | { |
| 914 | for (size_t i = _rows[_scroll]; i < _texts.size() && i < _rows[_scroll] + _visibleRows; ++i) |
| 915 | { |
| 916 | _arrowLeft[i]->setY(getY() + (i - _scroll) * (_font->getHeight() + _font->getSpacing())); |
| 917 | _arrowLeft[i]->blit(surface); |
| 918 | _arrowRight[i]->setY(getY() + (i - _scroll) * (_font->getHeight() + _font->getSpacing())); |
| 919 | _arrowRight[i]->blit(surface); |
| 920 | } |
| 921 | } |
| 922 | _up->blit(surface); |
| 923 | _down->blit(surface); |
| 924 | _scrollbar->blit(surface); |
| 925 | } |
| 926 | } |
| 927 | |
| 928 | /** |
| 929 | * Passes events to arrow buttons. |
no test coverage detected