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

Method GetIteratorFromPosition

src/textfile_gui.cpp:713–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711}
712
713std::vector<TextfileWindow::Line>::iterator TextfileWindow::GetIteratorFromPosition(int pos)
714{
715 for (auto it = std::begin(this->lines); it != std::end(this->lines); ++it) {
716 pos -= it->num_lines;
717 if (pos <= 0) return it;
718 }
719 return std::end(this->lines);
720}
721
722void TextfileWindow::ScrollToLine(size_t line)
723{

Callers 2

ReflowContentMethod · 0.95

Calls 2

beginFunction · 0.50
endFunction · 0.50

Tested by

no test coverage detected