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

Method UpdateVisibleIterators

src/textfile_gui.cpp:695–703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695void TextfileWindow::UpdateVisibleIterators()
696{
697 int pos = this->vscroll->GetPosition();
698 int cap = this->vscroll->GetCapacity();
699 this->visible_first = this->GetIteratorFromPosition(pos);
700
701 /* The last visible iterator ignores line wrapping so that it does not need to change when line heights change. */
702 this->visible_last = std::ranges::next(this->visible_first, cap + 1, std::end(this->lines));
703}
704
705void TextfileWindow::OnScrollbarScroll(WidgetID widget)
706{

Callers 4

OnResizeMethod · 0.95
OnRealtimeTickMethod · 0.95
OnScrollbarScrollMethod · 0.95
ScrollToLineMethod · 0.95

Calls 4

GetPositionMethod · 0.80
endFunction · 0.50
GetCapacityMethod · 0.45

Tested by

no test coverage detected